{"id":1,"date":"2023-01-18T14:44:21","date_gmt":"2023-01-18T14:44:21","guid":{"rendered":"https:\/\/thoaicoder.com\/?p=1"},"modified":"2024-01-07T22:54:45","modified_gmt":"2024-01-07T15:54:45","slug":"how-does-full-text-search-work","status":"publish","type":"post","link":"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/","title":{"rendered":"How does full-text search work?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>1. What is full-text search?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Full-text search (FTS) is a technique for <strong>searching a collection of documents for relevant results based on the presence of certain words or phrases<\/strong>. FTS is a branch of <strong>information retrieval<\/strong> and also relates to <strong>text mining<\/strong> and natural language processing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FTS uses an <strong>index &#8211; a special data structure<\/strong> of all the words present in all the documents to quickly locate results. It can also be used to search for documents that contain words or phrases that are s<strong>imilar but not exactly the same<\/strong>.<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-2-1024x730.png\" alt=\"\" class=\"wp-image-22\" width=\"628\" height=\"447\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-2-1024x730.png 1024w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-2-300x214.png 300w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-2-768x548.png 768w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-2.png 1144w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">FTS is especially useful when dealing with large collections of documents or a large number of queries that provide ranked search results. FTS is used in a variety of applications, including web search engines, online databases, social media, and enterprise search solutions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. Compare Full-Text Search queries to the LIKE predicate. Some popular full-text search engines<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">FTS queries are more powerful than the LIKE predicate <em>(e.g. SELECT * FROM employee WHERE name LIKE &#8216;Nguyen%&#8217;)<\/em>. The LIKE predicate can only search for exact substring matches, while FTS queries can use multiple operators to match words, phrases, and even similar words. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Additionally, FTS queries can be used to search for <strong>multiple words at once and can return ranked results that match multiple words<\/strong>, <strong>LIKE predicate can not rank results<\/strong>. <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Ranking is really important<\/strong> <strong>factor <\/strong>that help us to know which results are relevant the most and can be utilized in text similarly area by a <strong>&#8220;score&#8221;<\/strong> assigned to each result.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">FTS queries are also more efficient than the LIKE predicate, thank for <strong>FTS index<\/strong> that makes FTS must faster than the LIKE predicate (for example Google can reply to your query in only a few seconds with million returned results)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. Some popular full-text search engines<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The most popular full-text search engines are<strong> Apache Lucene, Apache Solr, Elasticsearch, and Sphinx<\/strong>. All of these search engines are open source, and <strong>they are all built on top of Lucene<\/strong>. Each of them has its own unique features and advantages, but they all provide powerful, scalable full-text search capabilities.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image.png\" alt=\"\" class=\"wp-image-16\" width=\"442\" height=\"249\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image.png 442w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-300x169.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">I won&#8217;t dive deep into these engines on this topic because this topic is about the background of full-text search so I will just talk about full-text search concepts and some full-text search models.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4. FTS basic model<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before diving deep into FTS basic model, we need to understand FTS input and output from end-user perspective.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FTS input:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Documents<\/strong>: a document or set of documents that are used to store and retrieve information. FTS documents are typically created and maintained by a computer program or system and are used to store information such as web content or social posts.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Query<\/strong>: a request made to an FTS system to retrieve documents that match a specified set of criteria. A query typically takes the form of a keyword or phrase, and the documents retrieved are those that contain the specified keywords or phrases (such as &#8220;spring framework&#8221; as in the above image).<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">FTS output:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Results<\/strong>: relevant ranked documents with the search query <\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">For example, we build an FTS system for a library that has <strong>100 books (documents) <\/strong>to search for relevant books by content. A user accesses this FTS system and searches <strong>&#8220;mafia books&#8221; (query)<\/strong>, then the system returns the top 3 relevant <strong>results <\/strong>ranked by a score (0 to 1) are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Godfather (0.96)<\/li>\n\n\n\n<li>The Sicilian (0.8)<\/li>\n\n\n\n<li>The Last Don (0.7)<br><\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The basic model of FTS consists of two basic stages, <strong>indexing <\/strong>and <strong>retrieval<\/strong>. A basic FTS system works based on the main components which are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A lexical unit (term) to represent documents and queries<\/li>\n\n\n\n<li>The matching function is used to map documents and queries<\/li>\n\n\n\n<li>Models represent documents and queries<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.1. Bag of words<\/strong> <strong>model<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Bag of words (BOW)<\/strong> is a document representation method used by most FTS systems. With BOW, the documents are indexed based on the words and in order to retrieve the information, the words in the query must appear in the index. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The main idea of BOW contains two steps<strong>:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Representing a document based on the frequency of occurrence of words<\/li>\n\n\n\n<li>Building a <strong>&#8220;feature vector&#8221;<\/strong> for the document with each element being a &#8220;<strong>weight<\/strong>&#8221; representing the importance of the word\/term<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s dive into a straightforward example to understand how BOW works with two simple documents:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>D1: \u201cThe cat sat on the car\u201d<br>D2: \u201cThe dog ate the cat and the car\u201d<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the above two documents, we have a vocabulary set:<strong> {the<\/strong>,<strong> cat, sat, on, car, dog, ate, and}<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Applying <strong>BOW <\/strong>to represent these two documents:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>in D1 for each word\/term in the vocabulary we have:<strong> &#8220;the&#8221; appears twice, and &#8220;cat&#8221;, &#8220;sat&#8221;, &#8220;on&#8221;, and &#8220;car&#8221; Each word appears once<\/strong>, <strong>the remaining three words do not appear<\/strong>, so the feature vector with D1 will be:<strong> { 2, 1, 1, 1, 1, 0, 0, 0 }<\/strong><\/li>\n\n\n\n<li>Similarly, the feature vector for D2 is: <strong>{ 3, 1, 0, 0, 1, 1, 1, 1}<\/strong><\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">At the indexing stage, the documents will usually go through a <strong>pre-processing step <\/strong>such as removing <a href=\"https:\/\/en.wikipedia.org\/wiki\/Stop_word\">stop words<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Stemming\">stemming<\/a>, etc., with the aim of reducing the size of the index to be stored.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.2. Vector space model<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Vector Space Model (VSM) is the improved version of BOW where each text document is represented as a vector using an algebraic model. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"561\" height=\"270\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-4.png\" alt=\"\" class=\"wp-image-58\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-4.png 561w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-4-300x144.png 300w\" sizes=\"auto, (max-width: 561px) 100vw, 561px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Most full-text search engines use VSM as the core model, and some of them combine VSM with other models.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Lucene uses a combination of the VSM and the Boolean model.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The idea of VSM is similar to BOW but the weight of each word is calculated in more detail. The VSM is constructed to have separate dimensions for each distinct word aggregated from all BOWs in the documents.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In VSM the weight is calculated based on the famous formula <strong>tf.idf<\/strong> (term frequency-inverse document frequency)<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"360\" height=\"227\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-5.png\" alt=\"\" class=\"wp-image-63\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-5.png 360w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-5-300x189.png 300w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">In VSM, vocabulary<strong> i<\/strong> with high weight will be words that appear frequently in document <strong>j<\/strong> but rarely appear in other documents.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In VSM, we denote <strong>T<\/strong> as a set of all vocabularies contained in the <strong>corpus (set of words)<\/strong>: <strong>T= {Term1, Term2,\u2026, Termt}, T = {ti}, i [1,..,t]<\/strong>. Based on the weight calculation using the formula<strong> tf.idf<\/strong>, VSM represents the document as a point in the vector space defined on T,<strong> each dimension corresponds to a word in the set of words<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>5. The common architecture of a full-text search system<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>entire full-text search system <\/strong>is as above including two stages indexing and retrieval, both documents and queries need to be preprocessed (remove stop word or stemming) as I mentioned earlier.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"359\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-10.png\" alt=\"\" class=\"wp-image-79\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-10.png 782w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-10-300x138.png 300w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-10-768x353.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Indexing<\/strong> <strong>stage<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Based on VSM we get an index matrix representing the document-vocabulary relationship in the corpus.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-6.png\" alt=\"\" class=\"wp-image-64\" width=\"626\" height=\"345\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-6.png 626w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-6-300x165.png 300w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Normally, most full-text search engines store this index matrix in encoded files. If you want to replicate your full-text search application, you only need to replicate these files. The image below is an example of Lucene index files.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"273\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-9.png\" alt=\"\" class=\"wp-image-78\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-9.png 725w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-9-300x113.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Retrieval<\/strong> <strong>stage<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At the information retrieval stage, we also <strong>represent the feature vector for the query<\/strong> similar to the representation for the vocabulary, then calculate the similarity of each document in the repository with the query using a <strong>matching function<\/strong> <strong>&#8211;<\/strong> <strong>Cosine similarity<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The similarity of the document and the query is calculated using the<strong> Cosine similarity<\/strong> for their two feature vectors, also known as the document&#8217;s score in the query.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"591\" height=\"124\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-7.png\" alt=\"\" class=\"wp-image-65\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-7.png 591w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/image-7-300x63.png 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>The more relevant documents are to the query, the higher the score will be<\/strong> so that we will retrieve the set of documents most relevant to the query.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. What is full-text search? Full-text search (FTS) is a technique for searching a collection [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":123,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[9,11,10,8,37],"class_list":["post-1","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-ml","tag-elasticsearch","tag-full-text-search","tag-information-retrieval","tag-lucene","tag-nlp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.14 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How does full-text search work? - I \u2764 Code<\/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:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How does full-text search work? - I \u2764 Code\" \/>\n<meta property=\"og:description\" content=\"1. What is full-text search? Full-text search (FTS) is a technique for searching a collection [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/\" \/>\n<meta property=\"og:site_name\" content=\"I \u2764 Code\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-18T14:44:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-07T15:54:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/download.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"168\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Thoai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/\"},\"author\":{\"name\":\"Thoai\",\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\"},\"headline\":\"How does full-text search work?\",\"datePublished\":\"2023-01-18T14:44:21+00:00\",\"dateModified\":\"2024-01-07T15:54:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/\"},\"wordCount\":1214,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\"},\"keywords\":[\"Elasticsearch\",\"Full text search\",\"Information Retrieval\",\"Lucene\",\"NLP\"],\"articleSection\":[\"AI\/ML\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/\",\"url\":\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/\",\"name\":\"How does full-text search work? - I \u2764 Code\",\"isPartOf\":{\"@id\":\"https:\/\/thoaicoder.com\/#website\"},\"datePublished\":\"2023-01-18T14:44:21+00:00\",\"dateModified\":\"2024-01-07T15:54:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/thoaicoder.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How does full-text search work?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/thoaicoder.com\/#website\",\"url\":\"https:\/\/thoaicoder.com\/\",\"name\":\"I \u2764 Code\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/thoaicoder.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\",\"name\":\"Thoai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg\",\"contentUrl\":\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg\",\"width\":640,\"height\":640,\"caption\":\"Thoai\"},\"logo\":{\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/thoaicoder.com\",\"https:\/\/www.linkedin.com\/in\/huu-thoai-nguyen\/\"],\"url\":\"https:\/\/thoaicoder.com\/index.php\/author\/admin_cvyxq4b8\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How does full-text search work? - I \u2764 Code","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:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/","og_locale":"en_US","og_type":"article","og_title":"How does full-text search work? - I \u2764 Code","og_description":"1. What is full-text search? Full-text search (FTS) is a technique for searching a collection [&hellip;]","og_url":"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/","og_site_name":"I \u2764 Code","article_published_time":"2023-01-18T14:44:21+00:00","article_modified_time":"2024-01-07T15:54:45+00:00","og_image":[{"width":300,"height":168,"url":"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/01\/download.png","type":"image\/png"}],"author":"Thoai","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Thoai","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/#article","isPartOf":{"@id":"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/"},"author":{"name":"Thoai","@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720"},"headline":"How does full-text search work?","datePublished":"2023-01-18T14:44:21+00:00","dateModified":"2024-01-07T15:54:45+00:00","mainEntityOfPage":{"@id":"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/"},"wordCount":1214,"commentCount":0,"publisher":{"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720"},"keywords":["Elasticsearch","Full text search","Information Retrieval","Lucene","NLP"],"articleSection":["AI\/ML"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/","url":"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/","name":"How does full-text search work? - I \u2764 Code","isPartOf":{"@id":"https:\/\/thoaicoder.com\/#website"},"datePublished":"2023-01-18T14:44:21+00:00","dateModified":"2024-01-07T15:54:45+00:00","breadcrumb":{"@id":"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/thoaicoder.com\/index.php\/2023\/01\/18\/how-does-full-text-search-work\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thoaicoder.com\/"},{"@type":"ListItem","position":2,"name":"How does full-text search work?"}]},{"@type":"WebSite","@id":"https:\/\/thoaicoder.com\/#website","url":"https:\/\/thoaicoder.com\/","name":"I \u2764 Code","description":"","publisher":{"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thoaicoder.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720","name":"Thoai","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/","url":"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg","contentUrl":"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg","width":640,"height":640,"caption":"Thoai"},"logo":{"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/thoaicoder.com","https:\/\/www.linkedin.com\/in\/huu-thoai-nguyen\/"],"url":"https:\/\/thoaicoder.com\/index.php\/author\/admin_cvyxq4b8\/"}]}},"_links":{"self":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":33,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":329,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions\/329"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/media\/123"}],"wp:attachment":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}