{"id":6565,"date":"2018-12-11T12:29:41","date_gmt":"2018-12-11T20:29:41","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=6565"},"modified":"2025-06-13T23:42:59","modified_gmt":"2025-06-14T06:42:59","slug":"n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/","title":{"rendered":"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL"},"content":{"rendered":"<p>With Couchbase v6.5, Full-Text Search is now integrated into the Couchbase N1QL query construct. Customers can now leverage FTS indexes directly with N1QL. This provides developers a single API to combine N1QL exact predicate matching and FTS powerful searching.<\/p>\n<p>The one constant challenge for many application developers with relational databases is query performance. Resolving query performance issues are often limited to what relational databases offer &#8212; getting a larger database server or better indexes.<\/p>\n<p>With Couchbase, N1QL query performance also relies on similar components. But unlike relational RDBMS, Couchbase architecture of services isolation means both the Query and Index services can be scaled out independently. With appropriate sizing and capacity planning, Couchbase can deliver blistering fast performance as shown in an <a href=\"https:\/\/www.altoros.com\/blog\/the-nosql-technical-comparison-report-cassandra-datastax-mongodb-and-couchbase-server\/\">Altoros NoSQL Benchmark<\/a> report.<\/p>\n<h3>Beyond Query Predicates &#8211; N1QL &amp; Search<\/h3>\n<p>Customers can achieve milliseconds response time for queries with appropriate indexes. However, there are times when the query predicates used by Couchbase GSI indexes are not known ahead of time. The ideal solution is to have an indexing system that could work with any combination of the available query predicates.<\/p>\n<p>Couchbase Adaptive Indexing can address many of these use cases. Couchbase Full-Text Search is another approach to irregular pattern use cases. They offer text and fuzzy search capabilities on any field in the document.<\/p>\n<p>Let&#8217;s consider the activity management document below. An activity:<\/p>\n<ol>\n<li>Always belong to a customer (account)<\/li>\n<li>Can also have multiple contacts from the customer&#8217;s organization and are represented by an array of contacts<\/li>\n<li>May include multiple participants, represented by an array of users.<\/li>\n<li>May be of type appointment or a task, both of which have their specific corresponding attributes, such as title, start date, due date, etc.<\/li>\n<li>An activity of type Task has an array of ToDo list<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6600 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-26-at-8.20.15-AM.png\" alt=\"sample json document for examples\" width=\"412\" height=\"356\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/Screen-Shot-2019-03-26-at-8.20.15-AM.png 412w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/Screen-Shot-2019-03-26-at-8.20.15-AM-300x259.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/Screen-Shot-2019-03-26-at-8.20.15-AM-20x17.png 20w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6598 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-26-at-8.18.22-AM.png\" alt=\"sample documents for examples\" width=\"492\" height=\"353\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/Screen-Shot-2019-03-26-at-8.18.22-AM.png 492w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/Screen-Shot-2019-03-26-at-8.18.22-AM-300x215.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/03\/Screen-Shot-2019-03-26-at-8.18.22-AM-20x14.png 20w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/p>\n<h3>The use case<\/h3>\n<p>John, a service representative for a call center at Acme Ltd needs to retrieve all the customer activities while he is on the phone with a customer. The customer may provide one or many of the values below for John to query the application:<\/p>\n<ol>\n<li>Activity title:\u00a0 The query should return all activities that have this text, anywhere in the activity title.<\/li>\n<li>Customer name: The entered customer name may be incomplete, thus the query needs to use a wildcard to match with the customer name.<\/li>\n<li>Contact name, email, or phone contact point: The customer may also provide contact person details. These may also be incomplete.<\/li>\n<li>A participant name: The customer may also provide the name of the account manager, an employee of Acme whom the customer has been interacted with and had been part of the activity.<\/li>\n<li>Activity date: Customer may provide a range of dates and times for the activities.<\/li>\n<li>The service rep may receive one or more of the above information. The pattern is not fixed.<\/li>\n<li>The query response time needs to be ~1 sec<\/li>\n<li>Data volume is 3millions per year and a retention period of 3 years.<\/li>\n<\/ol>\n<h3>What are the challenges to retrieve this information?<\/h3>\n<ol>\n<li>There could be up to eight fields that the customer can provide, and none of them are mandatory. This would pose a challenge for an efficient GSI Index design because covering index leading key needs to be present for the index selection. As the result, GSI indexes cannot cover all cases.<\/li>\n<li>Wildcard matching: The provided activity title, customer and contact name, email, or phone can be incomplete so an exact N1QL predicate matching technique will not work.<\/li>\n<li>Both contacts and participants are child objects for activities. In the JSON data model, contacts and participants are represented as two separate arrays. If we need a coverage index, it needs to include one or more elements from both arrays.<\/li>\n<\/ol>\n<h3>The solutions<\/h3>\n<h4>1. The simplest approach is to use N1QL predicates:<\/h4>\n<pre class=\"\">SELECT meta(a).id, a.title, a.startDate, a.account.name, a.contacts, a.participants\r\nFROM crm a \r\nWHERE \r\n  a.type='activity' \r\nAND a.activityType='Appointment'\r\nAND\r\n(\r\n    LOWER(a.title) LIKE '%artificial intelligence%'\r\nAND LOWER(a.account.name) LIKE '%collins%' \r\nAND ANY c in a.contacts SATISFIES LOWER(c.name) LIKE '%rogers%' END\r\nAND ANY c in a.contacts SATISFIES LOWER(c.email) = 'elliottpamela@gmail.com' END \r\nAND ANY c in a.contacts SATISFIES c.phone LIKE '%6816%' END\r\nAND ANY p in a.participants SATISFIES LOWER(p.name)LIKE '%james%' END \r\nAND a.startDate between '2016-08-29' AND '2016-08-30'\r\n)<\/pre>\n<p>The following GSI indexes would also be required:<\/p>\n<pre class=\"lang:default decode:true\">CREATE INDEX crm_activity_appt_startDate_accid_dur ON `crm`(`activityType`,`startDate`,`accid`,`duration`) WHERE `type` = 'activity'\r\nCREATE INDEX act_account_name_type ON `crm`(lower((`account`).`name`)) WHERE `type` = 'activity'\r\nCREATE INDEX act_contacts_name_type ON `crm`(DISTINCT ARRAY lower(`c`.`name`) FOR c in contacts END) WHERE `type` = 'activity'\r\nCREATE INDEX act_contacts_email_type ON `crm`(DISTINCT ARRAY lower(`c`.`email`) FOR c in contacts END) WHERE `type` = 'activity'\r\nCREATE INDEX act_contacts_phone_type ON `crm`(DISTINCT ARRAY c.phone FOR c in contacts END) WHERE `type` = 'activity'\r\nCREATE INDEX act_participants_name_type ON `crm`(DISTINCT ARRAY lower(`p`.`name`) FOR p in participants END) WHERE `type` = 'activity'\r\n\r\n<\/pre>\n<p>Note that the above query may use one or all of the available indexes to improve query performance. However, there could still be performance issues because of the need for the query plan to use IntersectScan operation.<\/p>\n<h4>2. Leverage FTS Index<\/h4>\n<p>Couchbase Full-Text Search could help with this use case, because of its non-exact search capability as well as the ability to search the fields in any order. Here is an FTS index that can cover the search criteria.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6619 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM.png\" alt=\"couchbase dialog for setting up a full text search index\" width=\"602\" height=\"828\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM.png 602w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-218x300.png 218w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-300x413.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-15x20.png 15w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/p>\n<h4>2.1 Using CURL &#8211; This is supported in Couchbase 5.5<\/h4>\n<pre class=\"lang:default decode:true\">SELECT meta(a).id, a.title,a.startDate, a.account.name, a.contacts, a.participants\r\nFROM CURL(\"https:\/\/localhost:8094\/api\/index\/all_acts\/query\", \r\n          {\"request\":\"POST\",\"header\":\"Content-Type: application\/json\", \"data\":\r\n          '{   \"explain\":false,\"fields\": [\"*\"],\r\n                \"highlight\": {},\r\n                \"query\": {\"conjuncts\":\r\n                      [  {\"field\":\"title\", \"match\": \"artificial intelligence\"} \r\n                      ,  {\"field\":\"contacts.name\", \"match\":\"rogers\"}\r\n                      ,  {\"field\":\"contacts.email\", \"match\":\"eliottpamela@gmail.com\"} \r\n                      ,  {\"field\":\"contacts.phone\", \"wildcard\":\"*6816*\"} \r\n                      ,  {\"field\":\"participants.name\", \"match\":\"james\"} \r\n                      ,  {\"field\":\"account.name\", \"match\":\"collins\"}\r\n                      ,  {\"field\":\"startDate\",\"start\": \"2016-08-29\", \"end\":\"2016-08-30\", \"inclusive_start\": true, \r\n                                      \"inclusive_end\": true} \r\n                      ] \r\n                  }\r\n          }',\r\n          \"user\":\"Administrator:password\"}) result\r\n          UNNEST result.hits h\r\n          INNER JOIN crm a ON (h.id = meta(a).id) AND a.type='activity'<\/pre>\n<h4>2.2\u00a0 With N1QL\/FTS integration using SEARCH_QUERY<\/h4>\n<pre class=\"\">SELECT meta(a).id, a.title,a.startDate, a.account.name, a.contacts, a.participants\r\nFROM SEARCH_QUERY(\"all_acts\",{\"explain\":false,\"fields\": [\"*\"],\"highlight\": {}, \r\n    \"query\": {\"conjuncts\":[ {\"field\":\"title\", \"match\": \"artificial intelligence\"} \r\n                          , {\"field\":\"contacts.name\", \"match\":\"rogers\"} \r\n                          ,  {\"field\":\"contacts.email\", \"match\":\"eliottpamela@gmail.com\"} \r\n                          ,  {\"field\":\"contacts.phone\", \"wildcard\":\"*6816*\"} \r\n                          ,  {\"field\": \"participants.name\", \"match\":\"james\"} \r\n                          ,  {\"field\": \"account.name\", \"match\":\"collins\"}\r\n                          ,  {\"field\": \"startDate\",\"start\": \"2016-08-29\", \"end\":\"2016-08-30\", \"inclusive_start\": true, \r\n                                   \"inclusive_end\": true}\r\n                          ] }}\r\n              ) as result\r\n          UNNEST result.hits h\r\n          INNER JOIN crm a ON (h.id = meta(a).id) AND a.type='activity'<\/pre>\n<h4>2.3\u00a0With N1QL\/FTS integration using N1QL SEARCH predicate<\/h4>\n<pre class=\"\">SELECT meta(a).id, a.title,a.startDate, a.account.name, a.contacts, a.participants\r\nFROM crm a\r\nWHERE a.type='activity'\r\nAND a.activityType='Appointment'\r\nAND SEARCH(a,\r\n   {\"conjuncts\":\r\n     [  {\"field\":\"title\", \"match\": \"artificial intelligence\"},\r\n        {\"field\":\"contacts.name\", \"match\":\"rogers\"},\r\n        {\"field\":\"contacts.email\", \"match\":\"eliottpamela@gmail.com\"},\r\n        {\"field\":\"contacts.phone\", \"wildcard\":\"*6816*\"},\r\n        {\"field\": \"participants.name\", \"match\":\"james\"},\r\n        {\"field\": \"account.name\", \"match\":\"collins\"},\r\n        {\"field\": \"startDate\",\"start\": \"2016-08-29\", \"end\":\"2016-08-30\", \"inclusive_start\": true, \"inclusive_end\": true}\r\n     ]\r\n    }, \r\n    {\"index\":\"all_acts\"}) \/* good practice to provide the specific index name *\/<\/pre>\n<p><strong>Notes:<\/strong><\/p>\n<ol>\n<li>The above example leverages the FTS compound query with the conjunct construct to combine all predicates into a single SEARCH(). Refer to Couchbase FTS documentation for more detail on <a href=\"https:\/\/docs.couchbase.com\/server\/6.0\/fts\/fts-query-types.html\">FTS Query type<\/a><\/li>\n<li>The above statement should be programmatically constructed to include only the required search predicates.<\/li>\n<li>The FTS index design must include the fields that are used in the SEARCH()<\/li>\n<li>The N1QL predicate\u00a0<strong>a.type=&#8217;activity&#8217;\u00a0<\/strong>must be present in the query for the FTS index selection<\/li>\n<\/ol>\n<p>N1QL SEARCH_QUERY and SEARCH predicate is part of the N1QL\/FTS Integration feature available in Couchbase v6.5 and I will update the blog with the documentation when it becomes available.<\/p>\n<p>For more detail on the FTS query syntax <a href=\"https:\/\/docs.couchbase.com\/server\/6.0\/fts\/full-text-intro.html\">https:\/\/docs.couchbase.com\/server\/6.0\/fts\/full-text-intro.html<\/a><\/p>\n<h4>N1QL &amp; Search Summary:<\/h4>\n<ol>\n<li>N1QL\/FTS integration allows a query to use FTS search construct directly as search predicates<\/li>\n<li>The use of the FTS index in the N1QL query alleviates the need to have an exact index for each query pattern<\/li>\n<li>N1QL\/FTS provides an additional option for developers to explore when dealing with query performance issues<\/li>\n<li>FTS index is well suited where you need to search on multiple fields in any order<\/li>\n<li>FTS index is well suited for cases where you need to search for fields in multiple arrays<\/li>\n<\/ol>\n<h4><b>Resources<\/b><\/h4>\n<ul>\n<li><i>Download<\/i>:\u00a0<a href=\"https:\/\/couchbase.com\/downloads?family=server&amp;product=couchbase-server-developer\">Download Couchbase Server 6.5<\/a><i><\/i><\/li>\n<li><i>Documentation<\/i>:\u00a0<a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/introduction\/whats-new.html\">Couchbase Server 6.5 What\u2019s New<\/a><i><\/i><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/tag\/6-5\/\"><b>All 6.5 Blogs<\/b><\/a><\/li>\n<\/ul>\n<p>We would love to hear from you on how you liked the 6.5 features and how they\u2019ll benefit your business going forward. Please share your feedback via the comments or in the <a href=\"https:\/\/www.couchbase.com\/forums\/\">forum<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Couchbase v6.5, Full-Text Search is now integrated into the Couchbase N1QL query construct. Customers can now leverage FTS indexes directly with N1QL. This provides developers a single API to combine N1QL exact predicate matching and FTS powerful searching. The [&hellip;]<\/p>\n","protected":false},"author":26326,"featured_media":10676,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1815,2165,1812],"tags":[],"ppma_author":[8919],"class_list":["post-6565","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-full-text-search","category-n1ql-query"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL<\/title>\n<meta name=\"description\" content=\"With Couchbase 6.5 Full Text Search is now available through N1QL queries - the single API combines N1QL exact predicate and powerful FTS matching.\" \/>\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\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL\" \/>\n<meta property=\"og:description\" content=\"With Couchbase 6.5 Full Text Search is now available through N1QL queries - the single API combines N1QL exact predicate and powerful FTS matching.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-11T20:29:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T06:42:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"656\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Binh Le\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Binh Le\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/\"},\"author\":{\"name\":\"Binh Le\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/f89064928e262c71eb43bee996c48c63\"},\"headline\":\"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL\",\"datePublished\":\"2018-12-11T20:29:41+00:00\",\"dateModified\":\"2025-06-14T06:42:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/\"},\"wordCount\":1019,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png\",\"articleSection\":[\"Best Practices and Tutorials\",\"Full-Text Search\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/\",\"name\":\"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png\",\"datePublished\":\"2018-12-11T20:29:41+00:00\",\"dateModified\":\"2025-06-14T06:42:59+00:00\",\"description\":\"With Couchbase 6.5 Full Text Search is now available through N1QL queries - the single API combines N1QL exact predicate and powerful FTS matching.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png\",\"width\":1200,\"height\":656},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL\"}]},{\"@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\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@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\/f89064928e262c71eb43bee996c48c63\",\"name\":\"Binh Le\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/5b68c37e30928a9d7b2c8470b1a303b7\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g\",\"caption\":\"Binh Le\"},\"description\":\"Binh Le is a Principal Product Manager for Couchbase Query service. Prior to Couchbase, he worked at Oracle and led the product management team for Sales Cloud Analytics and CRM OnDemand. Binh holds a Bachelor's Degree in Computer Science from the University of Brighton, UK.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/binh-le-2\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL","description":"With Couchbase 6.5 Full Text Search is now available through N1QL queries - the single API combines N1QL exact predicate and powerful FTS matching.","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\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/","og_locale":"en_US","og_type":"article","og_title":"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL","og_description":"With Couchbase 6.5 Full Text Search is now available through N1QL queries - the single API combines N1QL exact predicate and powerful FTS matching.","og_url":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/","og_site_name":"The Couchbase Blog","article_published_time":"2018-12-11T20:29:41+00:00","article_modified_time":"2025-06-14T06:42:59+00:00","og_image":[{"width":1200,"height":656,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png","type":"image\/png"}],"author":"Binh Le","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Binh Le","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/"},"author":{"name":"Binh Le","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/f89064928e262c71eb43bee996c48c63"},"headline":"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL","datePublished":"2018-12-11T20:29:41+00:00","dateModified":"2025-06-14T06:42:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/"},"wordCount":1019,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png","articleSection":["Best Practices and Tutorials","Full-Text Search","SQL++ \/ N1QL Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/","url":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/","name":"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png","datePublished":"2018-12-11T20:29:41+00:00","dateModified":"2025-06-14T06:42:59+00:00","description":"With Couchbase 6.5 Full Text Search is now available through N1QL queries - the single API combines N1QL exact predicate and powerful FTS matching.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/04\/Screen-Shot-2019-04-02-at-8.30.05-AM-1.png","width":1200,"height":656},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/n1ql-and-search-how-to-leverage-fts-index-in-n1ql-query\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"N1QL &amp; SEARCH: Leverage Full-Text Search (FTS) Index in N1QL"}]},{"@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":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@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\/f89064928e262c71eb43bee996c48c63","name":"Binh Le","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/5b68c37e30928a9d7b2c8470b1a303b7","url":"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g","caption":"Binh Le"},"description":"Binh Le is a Principal Product Manager for Couchbase Query service. Prior to Couchbase, he worked at Oracle and led the product management team for Sales Cloud Analytics and CRM OnDemand. Binh holds a Bachelor's Degree in Computer Science from the University of Brighton, UK.","url":"https:\/\/www.couchbase.com\/blog\/author\/binh-le-2\/"}]}},"authors":[{"term_id":8919,"user_id":26326,"is_guest":0,"slug":"binh-le-2","display_name":"Binh Le","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/a939f48df6447844a8780bec264bb3be21d589336f3915fabc557075a68fa374?s=96&d=mm&r=g","author_category":"","last_name":"Le","first_name":"Binh","job_title":"","user_url":"","description":"Binh Le is a Principal Product Manager for Couchbase Query service. Prior to Couchbase, he worked at Oracle and led the product management team for Sales Clould Analytics and CRM OnDemand. Binh holds a Bachelor's Degree in Computer Science from the University of Brighton, UK."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/6565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/26326"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=6565"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/6565\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/10676"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=6565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=6565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=6565"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=6565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}