{"id":3014,"date":"2019-11-03T13:26:16","date_gmt":"2019-11-03T13:26:16","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=3014"},"modified":"2023-07-19T12:02:35","modified_gmt":"2023-07-19T12:02:35","slug":"index-configurations","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/","title":{"rendered":"INDEX CONFIGURATIONS :"},"content":{"rendered":"<p>Index configurations are usually automatically specified by Elasticsearch. we can define our own index configurations to have an understanding of our data to be indexed. There are two configurations we can define for a particular index.<\/p>\n<p><strong><u>\u25baMappings <\/u><\/strong><\/p>\n<p>Mapping is the process of defining or specifying how a document, and the fields it contains, are stored and indexed in an index. Basically, It is a process of defining the schema of an index. For instance, use mappings to define:<br \/>\n<strong><u>\u25baMapping types :<\/u><\/strong><\/p>\n<p>There are two types of mappings in Elasticsearch.<\/p>\n<p><u>\u25baMeta-fields<\/u><\/p>\n<p>Meta-fields are used to define how a document\u2019s metadata associated is treated. Examples of meta-fields include the document\u2019s _index, _type, _id, and _source\u00a0fields.<\/p>\n<p><u>\u25baFields or Properties<\/u><\/p>\n<p>Properties contain a list of fields and their characteristics.<\/p>\n<p><strong><u>\u25baField datatypes :<\/u><\/strong><\/p>\n<p>text, keyword, long, date, double, Boolean, IP, nested, geo_point, geo_shape, completion.<\/p>\n<p>You can index string fields like text &amp; keyword with the standard analyzer, English analyzer, simple analyzer or any other analyzer as well.<\/p>\n<p>Example.<\/p>\n<p><strong>PUT BankAccountDetails<\/strong><\/p>\n<p>{<\/p>\n<p>&#8220;mappings&#8221;:{<\/p>\n<p>&#8220;properties&#8221;:{<\/p>\n<p>&#8220;name&#8221;: {<\/p>\n<p>&#8220;type&#8221;:\u00a0\u00a0\u00a0 &#8220;text&#8221;<\/p>\n<p>\u201canalyzer\u201d:\u00a0 \u201dstandard\u201d\u00a0\u00a0 },<\/p>\n<p>&#8220;date&#8221;: {<\/p>\n<p>&#8220;type&#8221;:\u00a0\u00a0\u00a0 &#8220;date&#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 },<\/p>\n<p>&#8220;balance&#8221;: {<\/p>\n<p>&#8220;type&#8221;:\u00a0\u00a0 &#8220;double&#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 },<\/p>\n<p>&#8220;liability&#8221;: {<\/p>\n<p>&#8220;type&#8221;:\u00a0\u00a0 &#8220;double&#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p><strong><u>\u25baSettings <\/u><\/strong><\/p>\n<p>You can configure shards, replicas, custom analyzers and many more settings related to an Index which we\u2019re going to store in ElasticSearch.<\/p>\n<p>Example:<\/p>\n<p>Here, we are defining how many shards, replicas we want and our own custom analyzer for a index BankAccountDetails<\/p>\n<p><strong>PUT \/BankAccountDetails\/_settings<\/strong><\/p>\n<p>{<\/p>\n<p>\u201cindex\u201d:{<\/p>\n<p>\u201cnumber_of_shards\u201d: 3,<\/p>\n<p>\u201cnumber_of_replicas\u201d: 2,<\/p>\n<p>\u201canalysis\u201d:{<\/p>\n<p>\u201canalyzer\u201d:{<\/p>\n<p>\u201ccontent\u201d:{<\/p>\n<p>\u201ctype\u201d: \u201ccustom\u201d,<\/p>\n<p>\u201ctokenizer\u201d: \u201cwhitespace\u201d<\/p>\n<p>}<\/p>\n<p>}\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Index configurations are usually automatically specified by Elasticsearch. we can define our own index configurations to have an understanding of our data to be indexed. There are two configurations we can define for a particular index. \u25baMappings Mapping is the process of defining or specifying how a document, and the fields it contains, are stored [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57,1702],"tags":[],"class_list":["post-3014","post","type-post","status-publish","format-standard","hentry","category-elastic-search","category-elasticsearch-modules"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>INDEX CONFIGURATIONS : - Prwatech<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"INDEX CONFIGURATIONS : - Prwatech\" \/>\n<meta property=\"og:description\" content=\"Index configurations are usually automatically specified by Elasticsearch. we can define our own index configurations to have an understanding of our data to be indexed. There are two configurations we can define for a particular index. \u25baMappings Mapping is the process of defining or specifying how a document, and the fields it contains, are stored [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-03T13:26:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-19T12:02:35+00:00\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/\",\"url\":\"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/\",\"name\":\"INDEX CONFIGURATIONS : - Prwatech\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"datePublished\":\"2019-11-03T13:26:16+00:00\",\"dateModified\":\"2023-07-19T12:02:35+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"INDEX CONFIGURATIONS :\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"INDEX CONFIGURATIONS : - Prwatech","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"INDEX CONFIGURATIONS : - Prwatech","og_description":"Index configurations are usually automatically specified by Elasticsearch. we can define our own index configurations to have an understanding of our data to be indexed. There are two configurations we can define for a particular index. \u25baMappings Mapping is the process of defining or specifying how a document, and the fields it contains, are stored [&hellip;]","og_url":"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2019-11-03T13:26:16+00:00","article_modified_time":"2023-07-19T12:02:35+00:00","author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/","url":"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/","name":"INDEX CONFIGURATIONS : - Prwatech","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"datePublished":"2019-11-03T13:26:16+00:00","dateModified":"2023-07-19T12:02:35+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/elastic-search\/elasticsearch-modules\/index-configurations\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"INDEX CONFIGURATIONS :"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/3014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=3014"}],"version-history":[{"count":5,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/3014\/revisions"}],"predecessor-version":[{"id":3820,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/3014\/revisions\/3820"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=3014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=3014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=3014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}