{"id":8849,"date":"2020-07-07T07:00:08","date_gmt":"2020-07-07T14:00:08","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=8849"},"modified":"2025-06-13T23:42:34","modified_gmt":"2025-06-14T06:42:34","slug":"first-class-sql-full-text-search-couchbase","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/first-class-sql-full-text-search-couchbase\/","title":{"rendered":"SQL de primeira classe para pesquisa de texto completo"},"content":{"rendered":"<p>Com o tempo, o setor de bancos de dados percebeu que a pesquisa de texto completo e o SQL s\u00e3o dois lados da mesma moeda.  A pesquisa de texto precisa de mais processamento de consulta e o processamento de consulta precisa de pesquisa de texto para filtrar com efici\u00eancia os padr\u00f5es de texto.   Os bancos de dados SQL adicionaram a pesquisa de texto completo a eles, embora para sistemas SMP de n\u00f3 \u00fanico.<\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>O SQL Server suporta <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/search\/full-text-search?view=sql-server-ver15\">CONTAINS() para pesquisa de texto<\/a><\/li>\n<li>A Oracle oferece suporte a <a href=\"https:\/\/docs.oracle.com\/cd\/B28359_01\/text.111\/b28303\/query.htm#BABGAIHJ\">CONTAINS() para pesquisa de texto<\/a><\/li>\n<li>MySQL adicionado f<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/fulltext-natural-language.html\">Suporte a texto completo\u00a0<\/a><\/li>\n<li>O PostgreSQL tem <a href=\"https:\/\/www.postgresql.org\/docs\/12\/functions-textsearch.html\">pesquisa de texto suportada<\/a> por um longo tempo.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">O Couchbase Full-Text Search (FTS) foi criado com tr\u00eas motiva\u00e7\u00f5es principais:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Pesquisa transparente em v\u00e1rios campos de um documento<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">V\u00e1 al\u00e9m da correspond\u00eancia exata de valores, fornecendo <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/fts\/fts-query-types.html\"><span style=\"font-weight: 400\">stemiza\u00e7\u00e3o baseada no idioma<\/span><\/a><span style=\"font-weight: 400\">, <a href=\"https:\/\/www.couchbase.com\/blog\/pt\/fuzzy-matching\/\">correspond\u00eancia difusa<\/a>etc.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Fornecer os resultados da pesquisa com base na relev\u00e2ncia<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">O FTS consegue isso com um \u00edndice invertido e um rico conjunto de <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/fts\/fts-query-types.html\"><span style=\"font-weight: 400\">predicados de consulta<\/span><\/a><span style=\"font-weight: 400\">O sistema oferece suporte \u00e0 pesquisa de palavras simples, \u00e0 correspond\u00eancia de padr\u00f5es e a predicados de intervalo complexos.    Al\u00e9m da pesquisa, ele oferece suporte \u00e0 agrega\u00e7\u00e3o por meio de <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/fts\/fts-response-object-schema.html#search-facets\"><span style=\"font-weight: 400\">facetas de pesquisa<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p>No mundo NoSQL, o Lucene \u00e9 um \u00edndice de pesquisa popular, assim como os servidores de pesquisa baseados no Lucene: <a href=\"https:\/\/lucene.apache.org\/solr\/\">Solr<\/a> e <a href=\"https:\/\/elastic.co\">Elasticsearch<\/a>.  Seguindo seus primos RDBMS, <a href=\"https:\/\/www.elastic.co\/\"><span style=\"font-weight: 400\">Elasticsearch<\/span><\/a><span style=\"font-weight: 400\">, <\/span><a href=\"https:\/\/opendistro.github.io\/for-elasticsearch\/\"><span style=\"font-weight: 400\">Opendistro para Elasticsearch<\/span><\/a><span style=\"font-weight: 400\"> todos adicionaram SQL em suas pesquisas.  O Couchbase introduziu o servi\u00e7o de texto completo,\u00a0<a href=\"https:\/\/docs.couchbase.com\/server\/current\/fts\/full-text-intro.html\">FTS<\/a> e deu continuidade ao suporte para pesquisa no N1QL.<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/introducing-fts-with-n1ql\/\"><span style=\"font-weight: 400\">FTS com N1QL<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/www.elastic.co\/what-is\/elasticsearch-sql\"><span style=\"font-weight: 400\">Elasticsearch com SQL<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/opendistro.github.io\/for-elasticsearch-docs\/docs\/sql\/\"><span style=\"font-weight: 400\">Opendistro para Elasticsearch com SQL<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">E o MongoDB, que entrou recentemente no mercado de pesquisa, adicionou <\/span><a href=\"https:\/\/docs.atlas.mongodb.com\/atlas-search\/\"><span style=\"font-weight: 400\">pesquisa para MQL<\/span><\/a><span style=\"font-weight: 400\"> usando o Lucene em sua oferta do Atlas. <\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>As implementa\u00e7\u00f5es SQL de <a href=\"https:\/\/www.elastic.co\/what-is\/elasticsearch-sql\">Elasticsearch com SQL<\/a> e <a href=\"https:\/\/docs.atlas.mongodb.com\/atlas-search\/\">MQL do MongoDB<\/a> vem com uma longa lista de limita\u00e7\u00f5es.<\/strong><\/p>\n<p><span style=\"font-weight: 400\"><a href=\"https:\/\/www.elastic.co\/what-is\/elasticsearch-sql\">Elasticsearch com SQL<\/a><\/span> listou suas limita\u00e7\u00f5es aqui:<\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>Lista completa: <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/current\/sql-limitations.html\">https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/current\/sql-limitations.html<\/a><\/li>\n<li>Al\u00e9m disso, o idioma \u00e9 compreensivelmente limitado devido \u00e0 sua implementa\u00e7\u00e3o incipiente.\n<ul>\n<li>N\u00e3o h\u00e1 suporte para jun\u00e7\u00f5es de opera\u00e7\u00f5es de conjunto, etc., etc.<\/li>\n<li>Nenhuma fun\u00e7\u00e3o de janela.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\"><a href=\"https:\/\/docs.atlas.mongodb.com\/atlas-search\/\">MQLs do MongoDB<\/a> A integra\u00e7\u00e3o de pesquisa vem com uma longa lista de limita\u00e7\u00f5es.<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>Dispon\u00edvel apenas no servi\u00e7o de pesquisa do Atlas, n\u00e3o no produto local.<\/li>\n<li>A pesquisa s\u00f3 pode ser a PRIMEIRA opera\u00e7\u00e3o dentro do pipeline aggregate().<\/li>\n<li>Dispon\u00edvel somente no pipeline de agrega\u00e7\u00e3o (aggregate()) e n\u00e3o em outras opera\u00e7\u00f5es como find(), insert(), update(), remove().<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">A integra\u00e7\u00e3o com sua API aggregate() vem com algumas limita\u00e7\u00f5es: Ela s\u00f3 pode ser a primeira opera\u00e7\u00e3o no pipeline indispon\u00edvel em seu banco de dados local. <\/span>Os recursos que discutimos neste artigo est\u00e3o no Couchbase 6.5 e superior.<\/p>\n<p>Aqui est\u00e1 um exemplo do N1QL:<\/p>\n<pre class=\"theme:familiar font-size:17 line-height:20 whitespace-before:2 whitespace-after:2 lang:mysql decode:true\">SELECT country, \r\n               city, \r\n               name, \r\n               ROW_NUMBER() OVER(ORDER BY country DESC, city DESC) rownum\r\nFROM `travel-sample` AS t1\r\nWHERE t1.type = \"hotel\" AND SEARCH(t1.description, \"garden\") \r\nAND ANY r in reviews satisfies r.ratings.Service &gt; 3 END;\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Isso inclui o seguinte, al\u00e9m de SEARCH():<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Proje\u00e7\u00e3o de campos dos documentos: pa\u00eds, cidade, nome<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Gera\u00e7\u00e3o de n\u00famero de linha por meio da fun\u00e7\u00e3o de janela ROW_NUMBER()<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Predicado escalar adicional t1.type = \"hotel\"<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Predicado de matriz sobre revis\u00f5es (ANY)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">Voc\u00ea obt\u00e9m o benef\u00edcio COMPLETO do processamento de consultas de primeira classe, al\u00e9m da pesquisa eficiente.  E isso n\u00e3o \u00e9 tudo - o N1QL oferece ainda mais. <\/span><span style=\"font-weight: 400\">Os benef\u00edcios e <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/unreasonable-effectiveness-of-sql\/\"><span style=\"font-weight: 400\">efic\u00e1cia do SQL<\/span><\/a><span style=\"font-weight: 400\"> s\u00e3o bem conhecidos.  N1QL \u00e9 SQL para JSON. O objetivo do N1QL \u00e9 oferecer aos desenvolvedores e \u00e0s empresas uma linguagem expressiva, poderosa e completa para consulta, transforma\u00e7\u00e3o e manipula\u00e7\u00e3o de dados JSON.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Os benef\u00edcios de usar <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/index.html\"><span style=\"font-weight: 400\">N1QL<\/span><\/a><span style=\"font-weight: 400\"> com a pesquisa s\u00e3o os seguintes:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Predicados:<\/span>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">O FTS \u00e9 excelente para pesquisas com base na relev\u00e2ncia. O SQL \u00e9 excelente com processamento adicional de consultas complexas: predicados complexos, predicados de matriz, escalar adicional\u00a0<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/arithmetic.html\"><span style=\"font-weight: 400\">Operadores<\/span><\/a><span style=\"font-weight: 400\"> e <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/aggregatefun.html\"><span style=\"font-weight: 400\">fun\u00e7\u00f5es<\/span><\/a><span style=\"font-weight: 400\">:<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Processamento de predicados (processamento de filtros)<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Predicados adicionais de escalar e matriz<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Fun\u00e7\u00f5es escalares e de matriz tamb\u00e9m podem ser usadas nos predicados<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Subconsultas<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Subconsultas correlacionadas<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Subconsultas n\u00e3o correlacionadas\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/aggregatefun.html\"><span style=\"font-weight: 400\">Agregados<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/windowfun.html\"><span style=\"font-weight: 400\">Fun\u00e7\u00f5es da janela<\/span><\/a><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Processamento de JOIN<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">O N1QL pode fazer INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN (limitado), NEST, UNNEST<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">JOINS entre compartimentos, cole\u00e7\u00f5es e resultados de subconsultas.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/union.html\"><span style=\"font-weight: 400\">Opera\u00e7\u00f5es SET<\/span><\/a>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">UNI\u00c3O<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">UNION ALL<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">EXCETO<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">EXCETO TODOS<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">INTERSEC\u00c7\u00c3O<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">INTERSECTAR TUDO<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/n1ql\/n1ql-language-reference\/with.html\"><span style=\"font-weight: 400\">CTE<\/span><\/a><span style=\"font-weight: 400\"> (Express\u00e3o de tabela comum) e <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/let.html\"><span style=\"font-weight: 400\">Cl\u00e1usula LET<\/span><\/a><span style=\"font-weight: 400\"> para melhorar a reda\u00e7\u00e3o de consultas<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Mais do que SEARCH()<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Al\u00e9m do SELECT, voc\u00ea pode usar o predicado SEARCH() nas cl\u00e1usulas WHERE dos comandos INSERT, UPDATE, DELETE e MERGE.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Voc\u00ea pode PREPARAR essas declara\u00e7\u00f5es e EXECUT\u00c1-LAS repetida e eficientemente.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Voc\u00ea obt\u00e9m a seguran\u00e7a usual por meio das fun\u00e7\u00f5es RBAC via GRANT &amp; REVOKE.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Produtividade do desenvolvedor: Escreva a consulta em SQL, a linguagem que eles j\u00e1 conhecem.<\/span><\/li>\n<\/ol>\n<p>Vamos dar uma olhada em como o mecanismo N1QL executa isso.  Abhinav Dangeti, da engenharia de FTS do Couchbase, j\u00e1 escreveu um <a href=\"https:\/\/www.couchbase.com\/blog\/pt\/introducing-fts-with-n1ql\/\">\u00f3timo blog que detalha a tomada de decis\u00f5es e os exemplos<\/a>.  Este artigo pretende explicar isso visualmente com exemplos adicionais nas categorias mencionadas acima.<\/p>\n<h5><strong>1.  ARQUITETURA para EXECU\u00c7\u00c3O DE CONSULTAS<\/strong><\/h5>\n<p>Adicionamos tr\u00eas etapas importantes \u00e0 execu\u00e7\u00e3o da consulta: a consulta usa SEARCH():<\/p>\n<ol>\n<li>O planejador considera o \u00edndice de pesquisa do FTS um dos caminhos de acesso v\u00e1lidos se o predicado search() existir na consulta.\n<ul>\n<li>Se o \u00edndice de pesquisa for selecionado, ele criar\u00e1 o plano empurrando o predicado de pesquisa para o \u00edndice FTS.<\/li>\n<\/ul>\n<\/li>\n<li>Quando o \u00edndice de pesquisa \u00e9 selecionado, o executor emite a solicita\u00e7\u00e3o de pesquisa para um dos n\u00f3s FTS (em vez da solicita\u00e7\u00e3o de varredura para o servi\u00e7o de \u00edndice)<\/li>\n<li>Antes que os resultados da pesquisa sejam finalizados, o servi\u00e7o de consulta verifica novamente a qualifica\u00e7\u00e3o da pesquisa do documento para os dados.<\/li>\n<\/ol>\n<div id=\"attachment_8852\" style=\"width: 855px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-01-at-7.02.40-PM.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8852\" class=\"wp-image-8852\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-01-at-7.02.40-PM-300x164.png\" alt=\"N1QL query execution with FTS\" width=\"845\" height=\"462\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.02.40-PM-300x164.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.02.40-PM-1024x559.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.02.40-PM-768x420.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.02.40-PM-1536x839.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.02.40-PM-2048x1119.png 2048w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.02.40-PM-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.02.40-PM-1320x721.png 1320w\" sizes=\"auto, (max-width: 845px) 100vw, 845px\" \/><\/a><p id=\"caption-attachment-8852\" class=\"wp-caption-text\">Execu\u00e7\u00e3o de consultas N1QL com FTS<\/p><\/div>\n<div id=\"attachment_8853\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-01-at-7.11.26-PM.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8853\" class=\"wp-image-8853\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-01-at-7.11.26-PM-300x127.png\" alt=\"Inside the Query Service\" width=\"839\" height=\"355\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.11.26-PM-300x127.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.11.26-PM-1024x433.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.11.26-PM-768x325.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.11.26-PM-1536x649.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.11.26-PM-2048x865.png 2048w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.11.26-PM-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-01-at-7.11.26-PM-1320x558.png 1320w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/a><p id=\"caption-attachment-8853\" class=\"wp-caption-text\">Dentro de um servi\u00e7o de consulta<\/p><\/div>\n<h5><\/h5>\n<h5><strong>2. PROCESSAMENTO DE PREDICADOS<\/strong><\/h5>\n<p>Na consulta a seguir, o predicado SEARCH() (predicado-2) \u00e9 enviado para a solicita\u00e7\u00e3o de pesquisa do FTS.  Todos os outros predicados s\u00e3o processados pelo mecanismo de consulta ap\u00f3s a pesquisa na fase \"Filtro\", conforme mostrado na figura \"Dentro de um servi\u00e7o de consulta\" acima.  Esta \u00e9 uma exce\u00e7\u00e3o a isso.  Quando o \u00edndice FTS tiver criado um \u00edndice com <strong>Campo de tipo JSON (doc_config.type_field no documento de defini\u00e7\u00e3o do \u00edndice)<\/strong>\u00a0\u00e9 definido (neste caso, tipo = \"hotel\") para criar o \u00edndice no subconjunto do documento, tanto a sele\u00e7\u00e3o do \u00edndice quanto o pushdown da pesquisa exploram esse predicado.  Mesmo nesse caso, o predicado \u00e9 reaplicado ap\u00f3s a busca do documento.<\/p>\n<pre class=\"theme:familiar font-size:17 line-height:20 whitespace-before:2 whitespace-after:2 lang:mysql decode:true\">SELECT country, \r\n               city, \r\n               name, \r\n               ROW_NUMBER() OVER(ORDER BY country DESC, city DESC) rownum\r\nFROM `travel-sample` AS t1\r\nWHERE \r\nt1.type = \"hotel\"   \/* predicate-1 *\/\r\nAND SEARCH(t1.description, \"garden\") \/* predicate-2 *\/\r\nAND ANY r in reviews satisfies r.ratings.Service &gt; 3 END; \/* predicate-2 *\/\r\n<\/pre>\n<h5><\/h5>\n<h5><strong>3. <a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/n1ql\/n1ql-language-reference\/operators.html\">OPERADORES<\/a> e <a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/n1ql\/n1ql-language-reference\/functions.html\">FUN\u00c7\u00d5ES<\/a><\/strong><\/h5>\n<p>Aqui est\u00e1 um exemplo de uma consulta que explora os operadores e as fun\u00e7\u00f5es.<\/p>\n<pre class=\"theme:familiar font-size:17 line-height:20 whitespace-before:2 whitespace-after:2 lang:mysql decode:true\">SELECT LOWER(country),   \/* scalar function *\/\r\n       city, \r\n       lastname || \" \" || firstname AS fullname   \/* string operator *\/\r\n       ROW_NUMBER() OVER(ORDER BY country DESC, city DESC) rownum   \/* window function *\/\r\nFROM `travel-sample` AS t1\r\nWHERE \r\nLOWER(t1.type) = \"hotel\"   \/* scalar function *\/\r\nAND SEARCH(t1.description, \"garden\") \r\nAND ARRAY_CONTAINS(public_likes, \"Joe Black\")  \/* Array function *\/\r\n<\/pre>\n<p>Aqui est\u00e1 o plano de consulta para essa consulta. O IndexSearch faz a solicita\u00e7\u00e3o de pesquisa do FTS e isso \u00e9 colocado em camadas no pipeline de execu\u00e7\u00e3o da consulta.  Assim, a consulta obt\u00e9m o benef\u00edcio de todos os outros recursos do N1QL.  Isso reflete os est\u00e1gios do pipeline na figura acima.<\/p>\n<div id=\"attachment_8856\" style=\"width: 1044px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-02-at-12.18.16-PM.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8856\" class=\"wp-image-8856\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-02-at-12.18.16-PM-300x190.png\" alt=\"Query plan with SEARCH()\" width=\"1034\" height=\"654\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-12.18.16-PM-300x190.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-12.18.16-PM-1024x647.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-12.18.16-PM-768x485.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-12.18.16-PM-1536x970.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-12.18.16-PM-20x13.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-12.18.16-PM-1320x834.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-12.18.16-PM.png 1722w\" sizes=\"auto, (max-width: 1034px) 100vw, 1034px\" \/><\/a><p id=\"caption-attachment-8856\" class=\"wp-caption-text\">Plano de consulta com SEARCH()<\/p><\/div>\n<h5>4. Processamento de JOIN<\/h5>\n<p>O SEARCH() tamb\u00e9m pode ser usado como parte do processamento de uni\u00e3o.  Nesse caso, o FTS \u00e9 usado para localizar todas as cidades que t\u00eam hot\u00e9is com jardins e, em seguida, unir-se aos aeroportos.<\/p>\n<pre class=\"theme:familiar font-size:17 line-height:20 whitespace-before:2 whitespace-after:2 lang:mysql decode:true\">SELECT hotel.name hname,\r\n       airport.city\r\nFROM `travel-sample` hotel \r\nLEFT OUTER JOIN `travel-sample` airport ON hotel.city = airport.city\r\nWHERE hotel.type = 'hotel'\r\n    AND SEARCH(hotel.description, \"garden\")\r\n    AND airport.type = 'airport' ;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_8857\" style=\"width: 777px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8857\" class=\"wp-image-8857\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM-300x200.png\" alt=\"JOIN with SEARCH\" width=\"767\" height=\"511\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM-300x200.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM-1024x683.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM-768x512.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM-1536x1024.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM-400x267.png 400w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM-450x300.png 450w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM-20x13.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM-1320x880.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-1.52.41-PM.png 1764w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/a><p id=\"caption-attachment-8857\" class=\"wp-caption-text\">JOIN com SEARCH<\/p><\/div>\n<h5>5. <a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/n1ql\/n1ql-language-reference\/with.html\">Express\u00f5es de tabela comuns (CTEs).<\/a><\/h5>\n<p>O N1QL no servi\u00e7o de consulta suporta CTEs n\u00e3o recursivos.   Voc\u00ea pode usar SEARCH() em cada express\u00e3o. A tabela derivada dessa express\u00e3o (hotel e aeroporto) \u00e9 usada como espa\u00e7o-chave na consulta.<\/p>\n<pre class=\"theme:familiar font-size:17 line-height:20 whitespace-before:2 whitespace-after:2 lang:mysql decode:true\">WITH hotel AS (\r\n    SELECT name,\r\n           city\r\n    FROM `travel-sample`\r\n    WHERE type = 'hotel'\r\n        AND search(description, \"garden\")),\r\nairport AS (\r\n    SELECT name,\r\n           city\r\n    FROM `travel-sample`\r\n    WHERE type = 'airport'\r\n        AND SEARCH(city, \"angeles\"))\r\nSELECT hotel.name hname,\r\n       airport.city\r\nFROM hotel\r\nINNER JOIN airport ON hotel.city = airport.city\r\nORDER BY airport.city,\r\n         hotel.name;\r\n<\/pre>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-02-at-3.00.13-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8858\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/07\/Screen-Shot-2020-07-02-at-3.00.13-PM-198x300.png\" alt=\"\" width=\"536\" height=\"812\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-3.00.13-PM-198x300.png 198w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-3.00.13-PM-300x454.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-3.00.13-PM-13x20.png 13w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/Screen-Shot-2020-07-02-at-3.00.13-PM.png 518w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/a><\/p>\n<h5><strong>5. Uso em UPDATEs<\/strong><\/h5>\n<p>SEARCH() pode ser usado em qualquer lugar onde um predicado \u00e9 permitido em outras instru\u00e7\u00f5es DML.<\/p>\n<pre class=\"theme:familiar font-size:17 line-height:20 whitespace-before:2 whitespace-after:2 lang:mysql decode:true\">\/* INSERT INTO... SELECT statement. *\/\r\nINSERT INTO mybucket (KEY id, VALUES v)\r\n          SELECT meta().id  id, v \r\n          FROM `travel-sample` v\r\n          WHERE SEARCH(v, \"+type:hotel  +description:clean\");\r\n\r\n\/* DELETE statement *\/\r\nDELETE FROM `travel-sample` WHERE SEARCH(v, \"+type:hotel +description:clean\");\r\n\r\n\/* UPDATE statement *\/\r\nUPDATE `travel-sample` SET new_field = \"search n update!\" WHERE SEARCH(v, \"+type:hotel +description:clean\"); \r\n\r\n\r\n<\/pre>\n<h5>Os exemplos podem fluir por muito tempo.  Mostrei exemplos comuns. Voc\u00ea usa isso em v\u00e1rias instru\u00e7\u00f5es SQL (DMLs)<\/h5>\n<h5><strong>Conclus\u00e3o<\/strong>:<\/h5>\n<p>O Couchbase FTS fornece um mecanismo de pesquisa de texto distribu\u00eddo e dimension\u00e1vel.  N\u00f3s o incorporamos perfeitamente ao N1QL no servi\u00e7o Couchbase Query para que voc\u00ea tenha todo o poder das consultas com todo o poder da pesquisa.   H\u00e1 mais inova\u00e7\u00f5es sobre isso em andamento. Fique ligado!<\/p>","protected":false},"excerpt":{"rendered":"<p>Over time, the database industry has realized full-text search and SQL are two sides of the same coin.\u00a0 Text search needs further query processing, query processing needs text search to efficiently filter for text patterns.\u00a0 \u00a0The SQL databases have added [&hellip;]<\/p>","protected":false},"author":55,"featured_media":8850,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1814,1815,1821,2165,1812],"tags":[1584,1292,1261],"ppma_author":[8929],"class_list":["post-8849","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-design","category-best-practices-and-tutorials","category-couchbase-architecture","category-full-text-search","category-n1ql-query","tag-bleve","tag-elasticsearch","tag-json"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>FIRST CLASS SQL for FULL-TEXT SEARCH - The Couchbase Blog<\/title>\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\/first-class-sql-full-text-search-couchbase\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FIRST CLASS SQL for FULL-TEXT SEARCH\" \/>\n<meta property=\"og:description\" content=\"Over time, the database industry has realized full-text search and SQL are two sides of the same coin.\u00a0 Text search needs further query processing, query processing needs text search to efficiently filter for text patterns.\u00a0 \u00a0The SQL databases have added [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/first-class-sql-full-text-search-couchbase\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-07T14:00:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T06:42:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1300\" \/>\n\t<meta property=\"og:image:height\" content=\"1244\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Keshav Murthy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rkeshavmurthy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Keshav Murthy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/\"},\"author\":{\"name\":\"Keshav Murthy\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636\"},\"headline\":\"FIRST CLASS SQL for FULL-TEXT SEARCH\",\"datePublished\":\"2020-07-07T14:00:08+00:00\",\"dateModified\":\"2025-06-14T06:42:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/\"},\"wordCount\":1197,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg\",\"keywords\":[\"bleve\",\"elasticsearch\",\"JSON\"],\"articleSection\":[\"Application Design\",\"Best Practices and Tutorials\",\"Couchbase Architecture\",\"Full-Text Search\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/\",\"name\":\"FIRST CLASS SQL for FULL-TEXT SEARCH - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg\",\"datePublished\":\"2020-07-07T14:00:08+00:00\",\"dateModified\":\"2025-06-14T06:42:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg\",\"width\":1300,\"height\":1244},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FIRST CLASS SQL for FULL-TEXT SEARCH\"}]},{\"@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\/c261644262bf98e146372fe647682636\",\"name\":\"Keshav Murthy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/4e51d72fc07c662aa791316deafffac4\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g\",\"caption\":\"Keshav Murthy\"},\"description\":\"Keshav Murthy is a Vice President at Couchbase R&amp;D. Previously, he was at MapR, IBM, Informix, Sybase, with more than 20 years of experience in database design &amp; development. He lead the SQL and NoSQL R&amp;D team at IBM Informix. He has received two President's Club awards at Couchbase, two Outstanding Technical Achievement Awards at IBM. Keshav has a bachelor's degree in Computer Science and Engineering from the University of Mysore, India, holds eleven US patents and has four US patents pending.\",\"sameAs\":[\"https:\/\/blog.planetnosql.com\/\",\"https:\/\/x.com\/rkeshavmurthy\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/pt\/author\/keshav-murthy\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"FIRST CLASS SQL for FULL-TEXT SEARCH - The Couchbase Blog","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\/first-class-sql-full-text-search-couchbase\/","og_locale":"pt_BR","og_type":"article","og_title":"FIRST CLASS SQL for FULL-TEXT SEARCH","og_description":"Over time, the database industry has realized full-text search and SQL are two sides of the same coin.\u00a0 Text search needs further query processing, query processing needs text search to efficiently filter for text patterns.\u00a0 \u00a0The SQL databases have added [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/first-class-sql-full-text-search-couchbase\/","og_site_name":"The Couchbase Blog","article_published_time":"2020-07-07T14:00:08+00:00","article_modified_time":"2025-06-14T06:42:34+00:00","og_image":[{"width":1300,"height":1244,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg","type":"image\/jpeg"}],"author":"Keshav Murthy","twitter_card":"summary_large_image","twitter_creator":"@rkeshavmurthy","twitter_misc":{"Written by":"Keshav Murthy","Est. reading time":"8 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/"},"author":{"name":"Keshav Murthy","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636"},"headline":"FIRST CLASS SQL for FULL-TEXT SEARCH","datePublished":"2020-07-07T14:00:08+00:00","dateModified":"2025-06-14T06:42:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/"},"wordCount":1197,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg","keywords":["bleve","elasticsearch","JSON"],"articleSection":["Application Design","Best Practices and Tutorials","Couchbase Architecture","Full-Text Search","SQL++ \/ N1QL Query"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/","url":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/","name":"FIRST CLASS SQL for FULL-TEXT SEARCH - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg","datePublished":"2020-07-07T14:00:08+00:00","dateModified":"2025-06-14T06:42:34+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/07\/triangle1-e1593651195823.jpg","width":1300,"height":1244},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/first-class-sql-full-text-search-couchbase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"FIRST CLASS SQL for FULL-TEXT SEARCH"}]},{"@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\/c261644262bf98e146372fe647682636","name":"Keshav Murthy","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/4e51d72fc07c662aa791316deafffac4","url":"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g","caption":"Keshav Murthy"},"description":"Keshav Murthy \u00e9 vice-presidente de P&amp;D da Couchbase. Anteriormente, ele trabalhou na MapR, IBM, Informix e Sybase, com mais de 20 anos de experi\u00eancia em design e desenvolvimento de bancos de dados. Ele liderou a equipe de P&amp;D de SQL e NoSQL na IBM Informix. Ele recebeu dois pr\u00eamios President's Club na Couchbase e dois Outstanding Technical Achievement Awards na IBM. Keshav \u00e9 bacharel em Ci\u00eancia da Computa\u00e7\u00e3o e Engenharia pela Universidade de Mysore, \u00cdndia, det\u00e9m onze patentes nos EUA e tem quatro patentes pendentes nos EUA.","sameAs":["https:\/\/blog.planetnosql.com\/","https:\/\/x.com\/rkeshavmurthy"],"url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/keshav-murthy\/"}]}},"authors":[{"term_id":8929,"user_id":55,"is_guest":0,"slug":"keshav-murthy","display_name":"Keshav Murthy","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g","first_name":"Keshav","last_name":"Murthy","user_url":"https:\/\/blog.planetnosql.com\/","author_category":"","description":"Keshav Murthy \u00e9 vice-presidente de P&amp;D da Couchbase. Anteriormente, ele trabalhou na MapR, IBM, Informix e Sybase, com mais de 20 anos de experi\u00eancia em design e desenvolvimento de bancos de dados. Ele liderou a equipe de P&amp;D de SQL e NoSQL na IBM Informix. Recebeu dois pr\u00eamios President's Club na Couchbase e dois Outstanding Technical Achievement Awards na IBM. Keshav \u00e9 bacharel em Ci\u00eancia da Computa\u00e7\u00e3o e Engenharia pela Universidade de Mysore, \u00cdndia, det\u00e9m dez patentes nos EUA e tem tr\u00eas patentes pendentes nos EUA."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/8849","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\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=8849"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/8849\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/8850"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=8849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=8849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=8849"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=8849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}