Elasticsearch indexes and mappings configuration

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Elasticsearch indexes and mappings configuration
Medium
~2-3 business days
FAQ

Our competencies:

Development stages

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1171
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1094
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    831
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    879
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    453

Elasticsearch Indexes and Mappings

Mapping is schema for index: defines field types, analyzers, and how fields are indexed for search.

Create Index with Mapping

PUT /products
{
  "settings": {
    "number_of_shards": 3,
    "number_of_replicas": 2,
    "index.analysis": {
      "analyzer": {
        "custom_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": ["lowercase", "stop"]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "id": { "type": "keyword" },
      "name": {
        "type": "text",
        "analyzer": "custom_analyzer",
        "fields": {
          "raw": { "type": "keyword" }
        }
      },
      "description": { "type": "text" },
      "price": { "type": "scaled_float", "scaling_factor": 100 },
      "stock": { "type": "integer" },
      "category": { "type": "keyword" },
      "created_at": { "type": "date" },
      "tags": { "type": "keyword" },
      "location": { "type": "geo_point" }
    }
  }
}

Common Field Types

  • text — analyzed text (search support)
  • keyword — exact match (used for filtering, aggregation)
  • integer, long — numbers
  • double, scaled_float — decimals
  • date — date/time
  • boolean — true/false
  • geo_point — coordinates
  • nested — array of objects
  • object — embedded object

Reindex with Mapping Change

# Create new index with new mapping
PUT /products_v2
{ ... new mapping ... }

# Reindex data from old to new
POST /_reindex
{
  "source": { "index": "products" },
  "dest": { "index": "products_v2" },
  "script": {
    "source": "ctx._source.new_field = 'default'"
  }
}

# Switch alias
POST /_aliases
{
  "actions": [
    { "remove": { "index": "products", "alias": "products_alias" } },
    { "add": { "index": "products_v2", "alias": "products_alias" } }
  ]
}