{"id":7964,"date":"2019-12-31T13:28:06","date_gmt":"2019-12-31T21:28:06","guid":{"rendered":"http:\/\/www.couchbase.com\/blog\/?p=7964"},"modified":"2025-06-13T20:59:07","modified_gmt":"2025-06-14T03:59:07","slug":"full-text-search-indexing-best-practices-by-use-case","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/full-text-search-indexing-best-practices-by-use-case\/","title":{"rendered":"Pr\u00e1ticas recomendadas de indexa\u00e7\u00e3o de pesquisa de texto completo por caso de uso"},"content":{"rendered":"<h2><span style=\"font-weight: 400\">Introduction<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Full text search (FTS) indexing can be challenging for those who are not familiar with search in general.\u00a0 In this post, we\u2019ll take some common search use cases and work through the creation of appropriate indexes following best practices for Couchbase FTS indexing.\u00a0<\/span><\/p>\n<h3><span style=\"font-weight: 400\">Use cases<\/span><\/h3>\n<p><span style=\"font-weight: 400\">The following common search use cases will be explored:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Simple search\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Field independent search<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Finding the Nearest Neighbor<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Search documents with a model that is changing all the time<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400\">Travel Sample Data Model<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Throughout this document, we\u2019ll be referencing the <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/manage\/manage-settings\/install-sample-buckets.html\"><span style=\"font-weight: 400\">Travel Sample dataset available to install<\/span><\/a><span style=\"font-weight: 400\"> in any Couchbase Server instance. The travel-sample bucket has several distinct document types: airline, route, airport, landmark, and hotel.\u00a0 The document model for each kind of document contains:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A key that acts as a primary key<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">An id field that identifies the document<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A type field that identifies the kind of document<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">The following figure illustrates the relationship between the different kinds of documents in the travel-sample bucket. It shows the primary key, ID, and type fields that each document has, plus a few representative fields in each type of document. <\/span><span style=\"font-weight: 400\">(Landmark documents are not pictured.)<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7985 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/FTS_BKane_Figure0.png\" alt=\"\" width=\"839\" height=\"764\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure0.png 839w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure0-300x273.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure0-768x699.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure0-20x18.png 20w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\"><i><span style=\"font-weight: 400\">Figure 0. Documents in the travel-sample data model<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-weight: 400\">Example Use Cases<\/span><\/h2>\n<h3><span style=\"font-weight: 400\">Simple Search<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Use case summary: a user will find hotels by searching the hotel description field for a keyword and see a list of matching hotels.\u00a0<\/span><\/p>\n<h4><span style=\"font-weight: 400\">Index creation steps:\u00a0<\/span><\/h4>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the Full Text Search UI, click \u201c<strong>Add Index<\/strong>\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Specify an index name, e.g. \u201chotel_desc\u201d, and select the travel-sample bucket.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Since each document in the travel-sample bucket has a \u201ctype\u201d field indicating the type of document, leave \u201cJSON type field\u201d set to \u201ctype\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Under type mappings:\u00a0\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click \u201c<strong>+ Add Type Mapping<\/strong>\u201d, and specify \u201chotel\u201d as the type name, since the requirement is to search all hotel documents.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A list of available analyzers can be accessed by means of the pull-down menu to the right of the type name field.\u00a0 For this use case, <\/span><span style=\"font-weight: 400\">leave \u201cinherit\u201d selected so <\/span><span style=\"font-weight: 400\">that the type mapping inherits the default analyzer from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Since the requirement is to search only the hotel description field, check \u201c<strong>only index specified fields<\/strong>\u201d.\u00a0 <\/span><em><span style=\"font-weight: 400\">With this checked, only user-specified fields from the document are included in the index for the<\/span><span style=\"font-weight: 400\"> hotel type mapping (the mapping will not be dynamic<\/span><span style=\"font-weight: 400\">, meaning that all fields are considered available for indexing<\/span><\/em><span style=\"font-weight: 400\"><em>).<\/em>\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click OK.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Mouse over the row with the hotel type mapping, click the <strong>+<\/strong> button, and then click \u201c<strong>insert child field<\/strong>\u201d.\u00a0 <em>This will allow the description field to be individually included in the index.<\/em> Specify the following:\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">field: Enter the name of the field to be indexed, \u201cdescription\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">type: Leave this set to text for the description field.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">searchable as: Leave this the same as the field name for the current use case.\u00a0 It can be used to indicate an alternate field name.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">analyzer: As was done for the type mapping, <\/span><span style=\"font-weight: 400\">for this use case, <\/span><span style=\"font-weight: 400\">leave \u201cinherit\u201d selected so <\/span><span style=\"font-weight: 400\">that the type mapping inherits the default analyzer.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">index checkbox: Leave this checked, so that the field is included in the index.\u00a0 <em>Unchecking the box would explicitly remove the field from the index.<\/em><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">store checkbox: <em>This setting includes the field content in the values returned from the search and permits highlighting of matched expressions in the results, but it also increases the size of the index and the build time.<\/em> Leave this unchecked since there\u2019s no requirement to highlight the results for this use case.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox: <strong>Uncheck<\/strong> this since the use case is to specifically search the description field.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude term vectors\u201d checkbox: <em>Certain kinds of functionality (such as highlighting, and phrase search) require term vectors, but this increases the size of the index and the build time.<\/em> <strong>Uncheck<\/strong> this box since the use case is a keyword search without highlighting.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click <strong>OK<\/strong>.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Finally, <strong>uncheck<\/strong> the checkbox next to the \u201cdefault\u201d type mapping.\u00a0 <em>If the default mapping is left enabled, all documents in the bucket are included in the index, regardless of whether the user actively specifies type mappings.<\/em> Only the hotel documents are required, and they are included by the hotel type mapping added previously.\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The default values suffice for the remaining collapsed panels (Analyzers, Custom Filters, Date\/Time Parsers, and Advanced).\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Index Replicas can be set to 1, 2 or 3, provided that the cluster is running the Search service on n+1 nodes. With a single node development cluster, maintain the default value of 0.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">For Index Type, the default value of \u201cVersion 6.0 (Scorch)\u201d is appropriate for any newly created indexes. <em>Scorch reduces the size of the index on disk, and provides enhanced performance for indexing and mutation-handling.<\/em><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">At this point, the create index page should look like the last frame captured in Figure 1.\u00a0 Click \u201c<strong>Create Index<\/strong>\u201d to complete the process.\u00a0<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8014 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/FTS_BKane_Figure1-capture-1.gif\" alt=\"\" width=\"562\" height=\"693\" \/><\/p>\n<p style=\"text-align: center\"><i><span style=\"font-weight: 400\">Figure 1 &#8211; Index Creation \u201chotel_desc\u201d<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Note: See \u201cIndex: hotel_desc\u201d in Appendix A for the JSON payload used to create this index with the REST API.\u00a0\u00a0<\/span><\/p>\n<h4><span style=\"font-weight: 400\">Testing queries against the index:\u00a0<\/span><\/h4>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the Full Text Search UI, wait for indexing progress to show 100%, then click on the index name \u201chotel_desc\u201d.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">To search for any hotels with the keyword \u201cfarm\u201d in the description, in the \u201csearch this index\u2026\u201d text box, enter \u201cdescription:farm\u201d and click Search.\u00a0 This field-scoping of the search is required because the <\/span><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox was left unchecked.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The results are shown (similar to Figure 2) with the key of each matching document.<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8013 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/FTS_BKane_Figure2-capture.gif\" alt=\"\" width=\"722\" height=\"484\" \/><\/p>\n<p style=\"text-align: center\"><i><span style=\"font-weight: 400\">Figure 2 &#8211; Index \u201chotel_desc\u201d search for \u201cdescription:farm\u201d<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400\">4. The same search can be run through the REST API using curl:\u00a0<\/span><\/p>\n<pre class=\"lang:default decode:true\">curl -u username:password -XPOST -H \"Content-Type: application\/json\" \\\r\nhttps:\/\/localhost:8094\/api\/index\/hotel_desc\/query \\\r\n-d '{\r\n  \"explain\": true,\r\n  \"fields\": [\r\n    \"*\"\r\n  ],\r\n  \"highlight\": {},\r\n  \"query\": {\r\n    \"query\": \"description:farm\"\r\n  }\r\n}'<\/pre>\n<h3><span style=\"font-weight: 400\">Field-independent Search<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Use case summary: a user will find hotels by searching the hotel name, alias, description, address, and reviews fields for a keyword and see a list of matching hotels <\/span><i><span style=\"font-weight: 400\">that includes the highlighted matches<\/span><\/i><span style=\"font-weight: 400\">.<\/span><\/p>\n<h4><span style=\"font-weight: 400\">Index creation steps:\u00a0<\/span><\/h4>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the Full Text Search UI, click \u201c<strong>Add Index<\/strong>\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Specify an index name, e.g. \u201chotel_mult_fields\u201d, and select the travel-sample bucket.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Since each document in the travel-sample bucket has a \u201ctype\u201d field indicating the type of document, leave \u201cJSON type field\u201d set to \u201ctype\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Under type mappings:\u00a0\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click \u201c<strong>+ Add Type Mapping<\/strong>\u201d, and specify \u201chotel\u201d as the type name, since the requirement is to search all hotel documents.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A list of available analyzers can be accessed by means of the pull-down menu to the right of the type name field.\u00a0 For this use case, leave \u201cinherit\u201d selected so that the type mapping inherits the default analyzer from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Since the requirement is to search hotel name, alias, description, address, and reviews fields, check \u201c<strong>only index specified fields<\/strong>\u201d.\u00a0 <em>With this checked, only user-specified fields from the document are included in the index for the hotel type mapping (the mapping will not be dynamic, meaning that all fields are considered available for indexing).\u00a0<\/em><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click <strong>OK<\/strong>.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Add each of the 5 fields to the hotel type mapping:<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Name: Mouse over the row with the hotel type mapping, click the <strong>+<\/strong> button, and then click \u201c<strong>insert child field<\/strong>\u201d.\u00a0 This will allow the hotel name field to be individually included in the index. Specify the following:\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">field: Enter the name of the field to be indexed, \u201cname\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">type: Leave this set to text for the name field.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">searchable as: Leave this the same as the field name for the current use case.\u00a0 It can be used to indicate an alternate field name.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">analyzer: As was done for the type mapping, <\/span><span style=\"font-weight: 400\">for this use case, <\/span><span style=\"font-weight: 400\">leave \u201cinherit\u201d selected so <\/span><span style=\"font-weight: 400\">that the type mapping inherits the default analyzer.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">index checkbox: Leave this checked so that the field is included in the index.\u00a0 Unchecking the box would explicitly remove the field from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">store checkbox: <strong>Check<\/strong> this setting<em> to include the field content in the search results which permits highlighting of matched expressions in the results.<\/em>\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox: Leave this checked since the use case requirement is to search multiple fields.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude term vectors\u201d checkbox: Leave this checked since the use case requires highlighting of results.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click <strong>OK<\/strong>.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Alias: Mouse over the row with the hotel type mapping, click the <strong>+<\/strong> button, and then click \u201c<strong>insert child field<\/strong>\u201d.\u00a0 This will allow the hotel name field to be individually included in the index. Specify the following:\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">field: Enter the name of the field to be indexed, \u201calias\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">type: Leave this set to text for the name field.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">searchable as: Leave this the same as the field name for the current use case.\u00a0 It can be used to indicate an alternate field name.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">analyzer: As was done for the type mapping, <\/span><span style=\"font-weight: 400\">for this use case, <\/span><span style=\"font-weight: 400\">leave \u201cinherit\u201d selected so <\/span><span style=\"font-weight: 400\">that the type mapping inherits the default analyzer.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">index checkbox: Leave this checked so that the field is included in the index.\u00a0 Unchecking the box would explicitly remove the field from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">store checkbox: <strong>Check<\/strong> this setting <em>to include the field content in the search results which permits highlighting of matched expressions in the results<\/em>.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox: Leave this checked since the use case requirement is to search multiple fields.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude term vectors\u201d checkbox: Leave this checked since the use case requires highlighting of results.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click <strong>OK<\/strong>.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Description: Mouse over the row with the hotel type mapping, click the <strong>+<\/strong> button, and then click \u201c<strong>insert child field<\/strong>\u201d.\u00a0 This will allow the hotel name field to be individually included in the index. Specify the following:\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">field: Enter the name of the field to be indexed, \u201cdescription\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">type: Leave this set to text for the name field.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">searchable as: Leave this the same as the field name for the current use case.\u00a0 It can be used to indicate an alternate field name.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">analyzer: As was done for the type mapping, <\/span><span style=\"font-weight: 400\">for this use case, <\/span><span style=\"font-weight: 400\">leave \u201cinherit\u201d selected so <\/span><span style=\"font-weight: 400\">that the type mapping inherits the default analyzer.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">index checkbox: Leave this checked so that the field is included in the index.\u00a0 Unchecking the box would explicitly remove the field from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">store checkbox: <strong>Check<\/strong> this setting <em>to include the field content in the search results which permits highlighting of matched expressions in the results.<\/em>\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox: Leave this checked since the use case requirement is to search multiple fields.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude term vectors\u201d checkbox: Leave this checked since the use case requires highlighting of results.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click <strong>OK<\/strong>.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Address: <\/span><span style=\"font-weight: 400\">Mouse over the row with the hotel type mapping, click the <strong>+<\/strong> button, and then click \u201c<strong>insert child field<\/strong>\u201d.\u00a0 This will allow the hotel name field to be individually included in the index. Specify the following:\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">field: Enter the name of the field to be indexed, \u201caddress\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">type: Leave this set to text for the name field.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">searchable as: Leave this the same as the field name for the current use case.\u00a0 It can be used to indicate an alternate field name.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">analyzer: As was done for the type mapping, <\/span><span style=\"font-weight: 400\">for this use case, <\/span><span style=\"font-weight: 400\">leave \u201cinherit\u201d selected so <\/span><span style=\"font-weight: 400\">that the type mapping inherits the default analyzer.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">index checkbox: Leave this checked so that the field is included in the index.\u00a0 Unchecking the box would explicitly remove the field from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">store checkbox: <strong>Check<\/strong> this setting to include the field content in the search results which permits highlighting of matched expressions in the results.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox: Leave this checked since the use case requirement is to search multiple fields.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude term vectors\u201d checkbox: Leave this checked since the use case requires highlighting of results.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click <strong>OK<\/strong>.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Reviews: <\/span><span style=\"font-weight: 400\">Mouse over the row with the hotel type mapping, click the <strong>+<\/strong> button, and then click \u201c<strong>insert child field<\/strong>\u201d.\u00a0 This will allow the hotel name field to be individually included in the index. Specify the following:\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">field: Enter the name of the field to be indexed, \u201creviews\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">type: Leave this set to text for the name field.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">searchable as: Leave this the same as the field name for the current use case.\u00a0 It can be used to indicate an alternate field name.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">analyzer: As was done for the type mapping, <\/span><span style=\"font-weight: 400\">for this use case, <\/span><span style=\"font-weight: 400\">leave \u201cinherit\u201d selected so <\/span><span style=\"font-weight: 400\">that the type mapping inherits the default analyzer.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">index checkbox: Leave this checked so that the field is included in the index.\u00a0 Unchecking the box would explicitly remove the field from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">store checkbox: <strong>Check<\/strong> this setting <em>to include the field content in the search results which permits highlighting of matched expressions in the results.<\/em>\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox: Leave this checked since the use case requirement is to search multiple fields.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude term vectors\u201d checkbox: Leave this checked since the use case requires highlighting of results.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click <strong>OK<\/strong>.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Finally, <strong>uncheck<\/strong> the checkbox next to the \u201cdefault\u201d type mapping.\u00a0 <em>If the default mapping is left enabled, all documents in the bucket are included in the index, regardless of whether the user actively specifies type mappings.<\/em> Only the hotel documents are required, and they are included by the hotel type mapping added previously.\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The default values suffice for the remaining collapsed panels (Analyzers, Custom Filters, Date\/Time Parsers, and Advanced).\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Index Replicas can be set to 1, 2 or 3, provided that the cluster is running the Search service on n+1 nodes. With a single node development cluster, maintain the default value of 0.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">For Index Type, the default value of \u201cVersion 6.0 (Scorch)\u201d is appropriate for any newly created indexes. Scorch reduces the size of the index on disk, and provides enhanced performance for indexing and mutation-handling.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">At this point, the create index page should look like the last frame captured in Figure 3.\u00a0 Click \u201c<strong>Create Index<\/strong>\u201d to complete the process.\u00a0<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8015 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/FTS_BKane_Figure3-capture.gif\" alt=\"\" width=\"575\" height=\"818\" \/><\/p>\n<p style=\"text-align: center\"><i><span style=\"font-weight: 400\">Figure 3 &#8211; Index Creation \u201chotel_mult_fields\u201d<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Note: See \u201cIndex: hotel_mult_fields\u201d in Appendix A for the JSON payload used to create this index through the REST API.\u00a0\u00a0<\/span><\/p>\n<h4><span style=\"font-weight: 400\">Testing queries against the index:\u00a0<\/span><\/h4>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the Full Text Search UI, wait for indexing progress to show 100%, then click on the index name \u201chotel_mult_fields\u201d.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">To search for any hotels with the keyword \u201cfarm\u201d in the name, alias, description, address, or reviews fields, in the \u201csearch this index\u2026\u201d text box, enter \u201cfarm\u201d and click Search.\u00a0 Field-scoping of the search is not required because the <\/span><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox was checked for each field indexed in the hotel type mapping.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The results are shown (similar to Figure 4) with the key of each matching document and the highlighted matches in each matching document.<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7989 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/FTS_BKane_Figure4.png\" alt=\"\" width=\"974\" height=\"1202\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure4.png 974w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure4-243x300.png 243w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure4-830x1024.png 830w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure4-768x948.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure4-300x370.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure4-16x20.png 16w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/p>\n<p style=\"text-align: center\"><i><span style=\"font-weight: 400\">Figure 4 &#8211; Index \u201chotel_mult_fields\u201d search results for \u201cfarm\u201d<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">4. The same search can be run through the REST API using curl:\u00a0<\/span><\/p>\n<pre class=\"lang:default decode:true\">curl -u username:password -XPOST -H \"Content-Type: application\/json\" \\\r\nhttps:\/\/localhost:8094\/api\/index\/hotel_mult_fields\/query \\\r\n-d '{\r\n  \"explain\": true,\r\n  \"fields\": [\r\n    \"*\"\r\n  ],\r\n  \"highlight\": {},\r\n  \"query\": {\r\n    \"query\": \"farm\"\r\n  }\r\n}'<\/pre>\n<h3><span style=\"font-weight: 400\">Finding the Nearest Neighbor<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Use case summary: a user will find hotels within a certain distance from a specified location and see a list of matching hotel names ordered by distance from the specified location.<\/span><\/p>\n<h4><span style=\"font-weight: 400\">Index creation steps:\u00a0<\/span><\/h4>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the Full Text Search UI, click \u201c<strong>Add Index<\/strong>\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Specify an index name, e.g. \u201chotel_geo\u201d, and select the travel-sample bucket.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Since each document in the travel-sample bucket has a \u201ctype\u201d field indicating the type of document, leave \u201cJSON type field\u201d set to \u201ctype\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Under type mappings:\u00a0\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click \u201c<strong>+ Add Type Mapping<\/strong>\u201d, and specify \u201chotel\u201d as the type name, since the requirement is to search all hotel documents.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A list of available analyzers can be accessed by means of the pull-down menu to the right of the type name field.\u00a0 For this use case, leave \u201cinherit\u201d selected so that the type mapping inherits the default analyzer from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Since the requirement is to search for the hotel location only, check \u201c<strong>only index specified fields<\/strong>\u201d.\u00a0 <em>With this checked, only user-specified fields from the document are included in the index for the hotel type mapping (the mapping will not be dynamic, meaning that all fields are considered available for indexing).\u00a0<\/em><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click <strong>OK<\/strong>.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Add the geo and name fields to the hotel type mapping:<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Geo: Mouse over the row with the hotel type mapping, click the <strong>+<\/strong> button, and then click \u201c<strong>insert child field<\/strong>\u201d.\u00a0 This will allow the hotel geo field to be individually included in the index. Specify the following:\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">field: Enter the name of the field to be indexed, \u201cgeo\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">type: Set this to <strong>geopoint<\/strong>.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">searchable as: Leave this the same as the field name for the current use case.\u00a0 It can be used to indicate an alternate field name.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">index checkbox: Leave this checked so that the field is included in the index.\u00a0 Unchecking the box would explicitly remove the field from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">store checkbox: <strong>Check<\/strong> this setting to include the field content in the search results.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox: Leave this checked since the use case requirement is to search the geo field.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click OK.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Name: Mouse over the row with the hotel type mapping, click the <strong>+<\/strong> button, and then click \u201c<strong>insert child field<\/strong>\u201d.\u00a0 This will allow the hotel name field to be individually included in the index. Specify the following:\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">field: Enter the name of the field to be indexed, \u201cname\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">type: Leave this set to text for the name field.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">searchable as: Leave this the same as the field name for the current use case.\u00a0 It can be used to indicate an alternate field name.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">analyzer: As was done for the type mapping, <\/span><span style=\"font-weight: 400\">for this use case, <\/span><span style=\"font-weight: 400\">leave \u201cinherit\u201d selected so <\/span><span style=\"font-weight: 400\">that the type mapping inherits the default analyzer.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">index checkbox: Leave this checked so that the field is included in the index.\u00a0 Unchecking the box would explicitly remove the field from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">store checkbox: <strong>Check<\/strong> this setting to include the field content in the search results.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude in _all field\u201d checkbox: <strong>Uncheck<\/strong> this <em>since the use case requirement is to search only by location but to display the name in the search results.\u00a0<\/em><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u201cinclude term vectors\u201d checkbox: <em>Certain kinds of functionality (such as highlighting, and phrase search) require term vectors, but this increases the size of the index and the build time.<\/em> <strong>Uncheck<\/strong> this box since the use case is to search by geo location only.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click OK.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Finally, <strong>uncheck<\/strong> the checkbox next to the \u201cdefault\u201d type mapping.\u00a0 <em>If the default mapping is left enabled, all documents in the bucket are included in the index, regardless of whether the user actively specifies type mappings. Only the hotel documents are required, and they are included by the hotel type mapping added previously.<\/em>\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The default values suffice for the remaining collapsed panels (Analyzers, Custom Filters, Date\/Time Parsers, and Advanced).\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Index Replicas can be set to 1, 2 or 3, provided that the cluster is running the Search service on n+1 nodes. With a single node development cluster, maintain the default value of 0.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">For Index Type, the default value of \u201cVersion 6.0 (Scorch)\u201d is appropriate for any newly created indexes. Scorch reduces the size of the index on disk, and provides enhanced performance for indexing and mutation-handling.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">At this point, the create index page should look like Figure 5.\u00a0 Click \u201c<strong>Create Index<\/strong>\u201d to complete the process.\u00a0<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7990 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/FTS_BKane_Figure5.png\" alt=\"\" width=\"831\" height=\"1089\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure5.png 831w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure5-229x300.png 229w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure5-781x1024.png 781w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure5-768x1006.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure5-300x393.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure5-15x20.png 15w\" sizes=\"auto, (max-width: 831px) 100vw, 831px\" \/><\/p>\n<p style=\"text-align: center\"><i><span style=\"font-weight: 400\">Figure 5 &#8211; Index Creation \u201chotel_geo\u201d<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Note: See \u201cIndex: hotel_geo\u201d in Appendix A for the JSON payload used to create this index through the REST API.\u00a0\u00a0<\/span><\/p>\n<h4><span style=\"font-weight: 400\">Testing queries against the index:\u00a0<\/span><\/h4>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the Full Text Search UI, wait for indexing progress to show 100%.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Only \u201cquery string\u201d queries can be tested through the Search UI in the Couchbase web console, so this <a href=\"https:\/\/www.couchbase.com\/blog\/geospatial-search-how-do-i-use-thee-let-me-count-the-ways\/\">geospatial search<\/a> will be tested through the REST API using curl.\u00a0 Search for the 2 nearest hotels within a mile of a location in San Francisco, returning the hotel name and coordinates ordered by distance using the following JSON query body:\u00a0\u00a0<\/span><\/li>\n<\/ol>\n<pre class=\"lang:default decode:true\" title=\"REST API call with JSON query body\">curl -u username:password -XPOST -H \"Content-Type: application\/json\" \\\r\nhttps:\/\/localhost:8094\/api\/index\/hotel_geo\/query \\\r\n-d '{\r\n  \"from\": 0,\r\n  \"size\": 2,\r\n  \"fields\": [\r\n    \"name\", \"geo\"\r\n  ],\r\n  \"query\": {\r\n    \"location\": {\r\n      \"lon\": -122.4194,\r\n      \"lat\": 37.7749\r\n     },\r\n    \"distance\": \"1mi\",\r\n    \"field\": \"geo\"\r\n  },\r\n  \"sort\": [\r\n    {\r\n      \"by\": \"geo_distance\",\r\n      \"field\": \"geo\",\r\n      \"unit\": \"mi\",\r\n      \"location\": {\r\n        \"lon\": -122.4194,\r\n        \"lat\": 37.7749\r\n      }\r\n    }\r\n  ]\r\n}'\r\n<\/pre>\n<p><span style=\"font-weight: 400\">3. Query result JSON:\u00a0<\/span><\/p>\n<pre class=\"lang:default decode:true \">{\r\n  \"status\": {\r\n    \"total\": 6,\r\n    \"failed\": 0,\r\n    \"successful\": 6\r\n  },\r\n  \"request\": {\r\n    \"query\": {\r\n      \"location\": [\r\n        -122.4194,\r\n        37.7749\r\n      ],\r\n      \"distance\": \"1mi\",\r\n      \"field\": \"geo\"\r\n    },\r\n    \"size\": 2,\r\n    \"from\": 0,\r\n    \"highlight\": null,\r\n    \"fields\": [\r\n      \"name\",\r\n      \"geo\"\r\n    ],\r\n    \"facets\": null,\r\n    \"explain\": false,\r\n    \"sort\": [\r\n      {\r\n        \"by\": \"geo_distance\",\r\n        \"field\": \"geo\",\r\n        \"location\": {\r\n          \"lat\": 37.7749,\r\n          \"lon\": -122.4194\r\n        },\r\n        \"unit\": \"mi\"\r\n      }\r\n    ],\r\n    \"includeLocations\": false\r\n  },\r\n  \"hits\": [\r\n    {\r\n      \"index\": \"hotel_geo_72ca6700aea9283d_aa574717\",\r\n      \"id\": \"hotel_25593\",\r\n      \"score\": 0.09668939164302555,\r\n      \"sort\": [\r\n        \" \\u0001?XA7]\\u0003\\u0010\\u0002\"\r\n      ],\r\n      \"fields\": {\r\n        \"geo\": [\r\n          -122.42000007592608,\r\n          37.7739999880488\r\n        ],\r\n        \"name\": \"Civic Center Hotel\"\r\n      }\r\n    },\r\n    {\r\n      \"index\": \"hotel_geo_72ca6700aea9283d_aa574717\",\r\n      \"id\": \"hotel_26263\",\r\n      \"score\": 0.09668939164302555,\r\n      \"sort\": [\r\n        \" \\u0001?h.&gt;\\u001dOJ\\\"7\"\r\n      ],\r\n      \"fields\": {\r\n        \"geo\": [\r\n          -122.42320003510062,\r\n          37.77719998913285\r\n        ],\r\n        \"name\": \"Hayes Valley Inn\"\r\n      }\r\n    }\r\n  ],\r\n  \"total_hits\": 37,\r\n  \"max_score\": 0.1169539736791776,\r\n  \"took\": 720591,\r\n  \"facets\": null\r\n}<\/pre>\n<h3><span style=\"font-weight: 400\">Dynamic Search<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Use case summary: a user will find hotels by searching for a keyword that appears in any attribute of the hotel document and see a list of matching hotels.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In this case, we want to search data that is changing all the time: fields are going to be added or removed, or fields may change from a simple string to an object, and our search should find the matching landmarks at all times.\u00a0 To meet this requirement, we will create a dynamic index.<\/span><\/p>\n<h4><span style=\"font-weight: 400\">Index creation steps:\u00a0<\/span><\/h4>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the Full Text Search UI, click \u201c<strong>Add Index<\/strong>\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Specify an index name, e.g. \u201chotel_dynamic\u201d, and select the travel-sample bucket.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Since each document in the travel-sample bucket has a \u201ctype\u201d field indicating the type of document, leave \u201cJSON type field\u201d set to \u201ctype\u201d.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Under type mappings:\u00a0\u00a0<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click \u201c<strong>+ Add Type Mapping<\/strong>\u201d, and specify \u201chotel\u201d as the type name, since the requirement is to search all hotel documents.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A list of available analyzers can be accessed by means of the pull-down menu to the right of the type name field.\u00a0 For this use case, leave \u201cinherit\u201d selected so that the type mapping inherits the default analyzer from the index.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Since the requirement is to search all hotel document fields, leave \u201c<strong>only index specified fields<\/strong>\u201d unchecked.\u00a0 <em>With this unchecked, the mapping will be dynamic, meaning that all fields are considered available for indexing.<\/em>\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click OK.\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Finally, <strong>uncheck<\/strong> the checkbox next to the \u201cdefault\u201d type mapping.\u00a0 <em>If the default mapping is left enabled, all documents in the bucket are included in the index, regardless of whether the user actively specifies type mappings. Only the hotel documents are required, and they are included by the hotel type mapping added previously.<\/em>\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The default values suffice for the remaining collapsed panels (Analyzers, Custom Filters, Date\/Time Parsers, and Advanced).\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Index Replicas can be set to 1, 2 or 3, provided that the cluster is running the Search service on n+1 nodes. With a single node development cluster, maintain the default value of 0.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">For Index Type, the default value of \u201cVersion 6.0 (Scorch)\u201d is appropriate for any newly created indexes. Scorch reduces the size of the index on disk, and provides enhanced performance for indexing and mutation-handling.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">At this point, the create index page should look like Figure 5.\u00a0 Click \u201c<strong>Create Index<\/strong>\u201d to complete the process.\u00a0<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7991 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/FTS_BKane_Figure6.png\" alt=\"\" width=\"833\" height=\"991\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure6.png 833w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure6-252x300.png 252w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure6-768x914.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure6-300x357.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure6-17x20.png 17w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/p>\n<p style=\"text-align: center\"><i><span style=\"font-weight: 400\">Figure 6 &#8211; Index Creation \u201chotel_dynamic\u201d<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400\">Note: See \u201cIndex: hotel_dynamic\u201d in Appendix A for the JSON payload used to create this index through the REST API.\u00a0\u00a0<\/span><\/p>\n<h4><span style=\"font-weight: 400\">Testing queries against the index:\u00a0<\/span><\/h4>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the Full Text Search UI, wait for indexing progress to show 100%, then click on the index name \u201chotel_dynamic\u201d.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">To search for any hotels with the keyword \u201cfarm\u201d in any fields of the hotel documents, in the \u201csearch this index\u2026\u201d text box, enter \u201cfarm\u201d and click Search.\u00a0 Field-scoping of the search is not required because all fields are included in the dynamic index<\/span><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The results are shown (similar to Figure 7) with the key of each matching document.<\/span><\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7992 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/FTS_BKane_Figure7.png\" alt=\"\" width=\"974\" height=\"441\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure7.png 974w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure7-300x136.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure7-768x348.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_Figure7-20x9.png 20w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/p>\n<p style=\"text-align: center\"><i><span style=\"font-weight: 400\">Figure 7 &#8211; Index \u201chotel_dynamic\u201d search results for \u201cfarm\u201d<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">4. The same search can be run through the REST API using curl:\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">curl -u username:password -XPOST -H \"Content-Type: application\/json\" \\\r\nhttps:\/\/localhost:8094\/api\/index\/hotel_dynamic\/query \\\r\n-d '{\r\n  \"fields\": [\r\n    \"*\"\r\n  ],\r\n  \"query\": {\r\n    \"query\": \"farm\"\r\n  }\r\n}'<\/pre>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-weight: 400\">Appendix A &#8211; Index Definition JSON<\/span><\/h2>\n<h3><span style=\"font-weight: 400\">Index: hotel_desc<\/span><\/h3>\n<pre class=\"lang:default decode:true\">{\r\n  \"type\": \"fulltext-index\",\r\n  \"name\": \"hotel_desc\",\r\n  \"uuid\": \"\",\r\n  \"sourceType\": \"couchbase\",\r\n  \"sourceName\": \"travel-sample\",\r\n  \"sourceUUID\": \"\",\r\n  \"planParams\": {\r\n    \"maxPartitionsPerPIndex\": 171\r\n  },\r\n  \"params\": {\r\n    \"doc_config\": {\r\n      \"docid_prefix_delim\": \"\",\r\n      \"docid_regexp\": \"\",\r\n      \"mode\": \"type_field\",\r\n      \"type_field\": \"type\"\r\n    },\r\n    \"mapping\": {\r\n      \"analysis\": {},\r\n      \"default_analyzer\": \"standard\",\r\n      \"default_datetime_parser\": \"dateTimeOptional\",\r\n      \"default_field\": \"_all\",\r\n      \"default_mapping\": {\r\n        \"dynamic\": true,\r\n        \"enabled\": false\r\n      },\r\n      \"default_type\": \"_default\",\r\n      \"docvalues_dynamic\": true,\r\n      \"index_dynamic\": true,\r\n      \"store_dynamic\": false,\r\n      \"type_field\": \"_type\",\r\n      \"types\": {\r\n        \"hotel\": {\r\n          \"dynamic\": false,\r\n          \"enabled\": true,\r\n          \"properties\": {\r\n            \"description\": {\r\n              \"dynamic\": false,\r\n              \"enabled\": true,\r\n              \"fields\": [\r\n                {\r\n                  \"index\": true,\r\n                  \"name\": \"description\",\r\n                  \"type\": \"text\"\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        }\r\n      }\r\n    },\r\n    \"store\": {\r\n      \"indexType\": \"scorch\",\r\n      \"kvStoreName\": \"\"\r\n    }\r\n  },\r\n  \"sourceParams\": {}\r\n}\r\n<\/pre>\n<h3><span style=\"font-weight: 400\">Index: hotel_mult_fields<\/span><\/h3>\n<pre class=\"lang:default decode:true \">{\r\n  \"type\": \"fulltext-index\",\r\n  \"name\": \"hotel_mult_fields\",\r\n  \"uuid\": \"\",\r\n  \"sourceType\": \"couchbase\",\r\n  \"sourceName\": \"travel-sample\",\r\n  \"sourceUUID\": \"\",\r\n  \"planParams\": {\r\n    \"maxPartitionsPerPIndex\": 171\r\n  },\r\n  \"params\": {\r\n    \"doc_config\": {\r\n      \"docid_prefix_delim\": \"\",\r\n      \"docid_regexp\": \"\",\r\n      \"mode\": \"type_field\",\r\n      \"type_field\": \"type\"\r\n    },\r\n    \"mapping\": {\r\n      \"analysis\": {},\r\n      \"default_analyzer\": \"standard\",\r\n      \"default_datetime_parser\": \"dateTimeOptional\",\r\n      \"default_field\": \"_all\",\r\n      \"default_mapping\": {\r\n        \"dynamic\": true,\r\n        \"enabled\": false\r\n      },\r\n      \"default_type\": \"_default\",\r\n      \"docvalues_dynamic\": true,\r\n      \"index_dynamic\": true,\r\n      \"store_dynamic\": false,\r\n      \"type_field\": \"_type\",\r\n      \"types\": {\r\n        \"hotel\": {\r\n          \"dynamic\": false,\r\n          \"enabled\": true,\r\n          \"properties\": {\r\n            \"address\": {\r\n              \"dynamic\": false,\r\n              \"enabled\": true,\r\n              \"fields\": [\r\n                {\r\n                  \"include_in_all\": true,\r\n                  \"include_term_vectors\": true,\r\n                  \"index\": true,\r\n                  \"name\": \"address\",\r\n                  \"store\": true,\r\n                  \"type\": \"text\"\r\n                }\r\n              ]\r\n            },\r\n            \"alias\": {\r\n              \"dynamic\": false,\r\n              \"enabled\": true,\r\n              \"fields\": [\r\n                {\r\n                  \"include_in_all\": true,\r\n                  \"include_term_vectors\": true,\r\n                  \"index\": true,\r\n                  \"name\": \"alias\",\r\n                  \"store\": true,\r\n                  \"type\": \"text\"\r\n                }\r\n              ]\r\n            },\r\n            \"description\": {\r\n              \"dynamic\": false,\r\n              \"enabled\": true,\r\n              \"fields\": [\r\n                {\r\n                  \"include_in_all\": true,\r\n                  \"include_term_vectors\": true,\r\n                  \"index\": true,\r\n                  \"name\": \"description\",\r\n                  \"store\": true,\r\n                  \"type\": \"text\"\r\n                }\r\n              ]\r\n            },\r\n            \"name\": {\r\n              \"dynamic\": false,\r\n              \"enabled\": true,\r\n              \"fields\": [\r\n                {\r\n                  \"include_in_all\": true,\r\n                  \"include_term_vectors\": true,\r\n                  \"index\": true,\r\n                  \"name\": \"name\",\r\n                  \"store\": true,\r\n                  \"type\": \"text\"\r\n                }\r\n              ]\r\n            },\r\n            \"reviews\": {\r\n              \"dynamic\": false,\r\n              \"enabled\": true,\r\n              \"fields\": [\r\n                {\r\n                  \"include_in_all\": true,\r\n                  \"include_term_vectors\": true,\r\n                  \"index\": true,\r\n                  \"name\": \"reviews\",\r\n                  \"store\": true,\r\n                  \"type\": \"text\"\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        }\r\n      }\r\n    },\r\n    \"store\": {\r\n      \"indexType\": \"scorch\",\r\n      \"kvStoreName\": \"\"\r\n    }\r\n  },\r\n  \"sourceParams\": {}\r\n}\r\n<\/pre>\n<h3><span style=\"font-weight: 400\">Index: hotel_geo<\/span><\/h3>\n<pre class=\"lang:default decode:true \">{\r\n \"name\": \"hotel_geo\",\r\n \"type\": \"fulltext-index\",\r\n \"params\": {\r\n  \"mapping\": {\r\n   \"types\": {\r\n    \"hotel\": {\r\n     \"enabled\": true,\r\n     \"dynamic\": false,\r\n     \"properties\": {\r\n      \"name\": {\r\n       \"enabled\": true,\r\n       \"dynamic\": false,\r\n       \"fields\": [\r\n        {\r\n         \"name\": \"name\",\r\n         \"type\": \"text\",\r\n         \"store\": true,\r\n         \"index\": true,\r\n         \"include_term_vectors\": false,\r\n         \"include_in_all\": false\r\n        }\r\n       ]\r\n      },\r\n      \"geo\": {\r\n       \"enabled\": true,\r\n       \"dynamic\": false,\r\n       \"fields\": [\r\n        {\r\n         \"name\": \"geo\",\r\n         \"type\": \"geopoint\",\r\n         \"store\": true,\r\n         \"index\": true,\r\n         \"include_term_vectors\": true,\r\n         \"include_in_all\": true\r\n        }\r\n       ]\r\n      }\r\n     }\r\n    }\r\n   },\r\n   \"default_mapping\": {\r\n    \"enabled\": false,\r\n    \"dynamic\": true\r\n   },\r\n   \"default_type\": \"_default\",\r\n   \"default_analyzer\": \"standard\",\r\n   \"default_datetime_parser\": \"dateTimeOptional\",\r\n   \"default_field\": \"_all\",\r\n   \"store_dynamic\": false,\r\n   \"index_dynamic\": true\r\n  },\r\n  \"store\": {\r\n   \"indexType\": \"scorch\",\r\n   \"kvStoreName\": \"\"\r\n  },\r\n  \"doc_config\": {\r\n   \"mode\": \"type_field\",\r\n   \"type_field\": \"type\",\r\n   \"docid_prefix_delim\": \"\",\r\n   \"docid_regexp\": \"\"\r\n  }\r\n },\r\n \"sourceType\": \"couchbase\",\r\n \"sourceName\": \"travel-sample\",\r\n \"sourceUUID\": \"\",\r\n \"sourceParams\": {},\r\n \"planParams\": {\r\n  \"maxPartitionsPerPIndex\": 171,\r\n  \"numReplicas\": 0\r\n },\r\n \"uuid\": \"\"\r\n}\r\n<\/pre>\n<h3><span style=\"font-weight: 400\">Index: hotel_dynamic<\/span><\/h3>\n<pre class=\"lang:default decode:true \">{\r\n \"name\": \"hotel_dynamic\",\r\n \"type\": \"fulltext-index\",\r\n \"params\": {\r\n  \"mapping\": {\r\n   \"types\": {\r\n    \"hotel\": {\r\n     \"enabled\": true,\r\n     \"dynamic\": true\r\n    }\r\n   },\r\n   \"default_mapping\": {\r\n    \"enabled\": false,\r\n    \"dynamic\": true\r\n   },\r\n   \"default_type\": \"_default\",\r\n   \"default_analyzer\": \"standard\",\r\n   \"default_datetime_parser\": \"dateTimeOptional\",\r\n   \"default_field\": \"_all\",\r\n   \"store_dynamic\": false,\r\n   \"index_dynamic\": true\r\n  },\r\n  \"store\": {\r\n   \"indexType\": \"scorch\",\r\n   \"kvStoreName\": \"\"\r\n  },\r\n  \"doc_config\": {\r\n   \"mode\": \"type_field\",\r\n   \"type_field\": \"type\",\r\n   \"docid_prefix_delim\": \"\",\r\n   \"docid_regexp\": \"\"\r\n  }\r\n },\r\n \"sourceType\": \"couchbase\",\r\n \"sourceName\": \"travel-sample\",\r\n \"sourceUUID\": \"\",\r\n \"sourceParams\": {},\r\n \"planParams\": {\r\n  \"maxPartitionsPerPIndex\": 171,\r\n  \"numReplicas\": 0\r\n },\r\n \"uuid\": \"\"\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Full text search (FTS) indexing can be challenging for those who are not familiar with search in general.\u00a0 In this post, we\u2019ll take some common search use cases and work through the creation of appropriate indexes following best practices [&hellip;]<\/p>\n","protected":false},"author":16362,"featured_media":7993,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1815,1816,2165],"tags":[],"ppma_author":[9100],"class_list":["post-7964","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-couchbase-server","category-full-text-search"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Full Text Search Indexing Best Practices by Use Case Examples<\/title>\n<meta name=\"description\" content=\"Take a look at some common search use cases and work through the creation of appropriate indexes following best practices for Couchbase FTS indexing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/pt\/full-text-search-indexing-best-practices-by-use-case\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Full Text Search Indexing Best Practices by Use Case\" \/>\n<meta property=\"og:description\" content=\"Take a look at some common search use cases and work through the creation of appropriate indexes following best practices for Couchbase FTS indexing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/full-text-search-indexing-best-practices-by-use-case\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-31T21:28:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T03:59:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_scrabble.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1279\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Brian Kane, Solutions Engineer, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brian Kane, Solutions Engineer, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/\"},\"author\":{\"name\":\"Brian Kane, Solutions Engineer, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/69569e5446e8ee83e32f8e5ed50a250e\"},\"headline\":\"Full Text Search Indexing Best Practices by Use Case\",\"datePublished\":\"2019-12-31T21:28:06+00:00\",\"dateModified\":\"2025-06-14T03:59:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/\"},\"wordCount\":3761,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2019\\\/12\\\/FTS_BKane_scrabble.jpg\",\"articleSection\":[\"Best Practices and Tutorials\",\"Couchbase Server\",\"Full-Text Search\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/\",\"name\":\"Full Text Search Indexing Best Practices by Use Case Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2019\\\/12\\\/FTS_BKane_scrabble.jpg\",\"datePublished\":\"2019-12-31T21:28:06+00:00\",\"dateModified\":\"2025-06-14T03:59:07+00:00\",\"description\":\"Take a look at some common search use cases and work through the creation of appropriate indexes following best practices for Couchbase FTS indexing.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2019\\\/12\\\/FTS_BKane_scrabble.jpg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2019\\\/12\\\/FTS_BKane_scrabble.jpg\",\"width\":1920,\"height\":1279},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/full-text-search-indexing-best-practices-by-use-case\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Full Text Search Indexing Best Practices by Use Case\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/admin-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/69569e5446e8ee83e32f8e5ed50a250e\",\"name\":\"Brian Kane, Solutions Engineer, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/366c828464bd7bc90174aca4473a71c317f4578e440915acf85a1de7e170c1e0?s=96&d=mm&r=gd6ceb7493ed6dce23e12c34a4d31643e\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/366c828464bd7bc90174aca4473a71c317f4578e440915acf85a1de7e170c1e0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/366c828464bd7bc90174aca4473a71c317f4578e440915acf85a1de7e170c1e0?s=96&d=mm&r=g\",\"caption\":\"Brian Kane, Solutions Engineer, Couchbase\"},\"description\":\"Brian Kane is a Solutions Engineer at Couchbase and has been working in application development and with database technologies since 1996. He is based in the Houston, Texas area.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/pt\\\/author\\\/brian-kanecouchbase-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Full Text Search Indexing Best Practices by Use Case Examples","description":"D\u00ea uma olhada em alguns casos de uso de pesquisa comuns e trabalhe na cria\u00e7\u00e3o de \u00edndices apropriados seguindo as pr\u00e1ticas recomendadas para a indexa\u00e7\u00e3o do Couchbase FTS.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/pt\/full-text-search-indexing-best-practices-by-use-case\/","og_locale":"pt_BR","og_type":"article","og_title":"Full Text Search Indexing Best Practices by Use Case","og_description":"Take a look at some common search use cases and work through the creation of appropriate indexes following best practices for Couchbase FTS indexing.","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/full-text-search-indexing-best-practices-by-use-case\/","og_site_name":"The Couchbase Blog","article_published_time":"2019-12-31T21:28:06+00:00","article_modified_time":"2025-06-14T03:59:07+00:00","og_image":[{"width":1920,"height":1279,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_scrabble.jpg","type":"image\/jpeg"}],"author":"Brian Kane, Solutions Engineer, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Brian Kane, Solutions Engineer, Couchbase","Est. reading time":"19 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/"},"author":{"name":"Brian Kane, Solutions Engineer, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/69569e5446e8ee83e32f8e5ed50a250e"},"headline":"Full Text Search Indexing Best Practices by Use Case","datePublished":"2019-12-31T21:28:06+00:00","dateModified":"2025-06-14T03:59:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/"},"wordCount":3761,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_scrabble.jpg","articleSection":["Best Practices and Tutorials","Couchbase Server","Full-Text Search"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/","url":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/","name":"Full Text Search Indexing Best Practices by Use Case Examples","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_scrabble.jpg","datePublished":"2019-12-31T21:28:06+00:00","dateModified":"2025-06-14T03:59:07+00:00","description":"D\u00ea uma olhada em alguns casos de uso de pesquisa comuns e trabalhe na cria\u00e7\u00e3o de \u00edndices apropriados seguindo as pr\u00e1ticas recomendadas para a indexa\u00e7\u00e3o do Couchbase FTS.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_scrabble.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/FTS_BKane_scrabble.jpg","width":1920,"height":1279},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/full-text-search-indexing-best-practices-by-use-case\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Full Text Search Indexing Best Practices by Use Case"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/69569e5446e8ee83e32f8e5ed50a250e","name":"Brian Kane, engenheiro de solu\u00e7\u00f5es, Couchbase","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/366c828464bd7bc90174aca4473a71c317f4578e440915acf85a1de7e170c1e0?s=96&d=mm&r=gd6ceb7493ed6dce23e12c34a4d31643e","url":"https:\/\/secure.gravatar.com\/avatar\/366c828464bd7bc90174aca4473a71c317f4578e440915acf85a1de7e170c1e0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/366c828464bd7bc90174aca4473a71c317f4578e440915acf85a1de7e170c1e0?s=96&d=mm&r=g","caption":"Brian Kane, Solutions Engineer, Couchbase"},"description":"Brian Kane \u00e9 engenheiro de solu\u00e7\u00f5es da Couchbase e trabalha com desenvolvimento de aplicativos e tecnologias de banco de dados desde 1996. Ele mora na regi\u00e3o de Houston, Texas.","url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/brian-kanecouchbase-com\/"}]}},"acf":[],"authors":[{"term_id":9100,"user_id":16362,"is_guest":0,"slug":"brian-kanecouchbase-com","display_name":"Brian Kane, Solutions Engineer, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/366c828464bd7bc90174aca4473a71c317f4578e440915acf85a1de7e170c1e0?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/7964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/16362"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=7964"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/7964\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/7993"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=7964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=7964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=7964"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=7964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}