# Full Text Search

Full-text search is a specialised **search technique** that allows users to search for text within large amounts of textual data and **retrieve relevant documents** or records that contain the queried words or phrases.&#x20;

Full-text search enables users to find relevant information even if the search terms are not an exact match.

While traditional databases can handle some text-based searching using techniques like wildcard or pattern matching, they are not optimised for efficient full-text search across extensive text data.

## Understanding full-text search using a example

Imagine a library database with a collection of book records. Each record includes details such as the book's title, author, genre, and a brief description. Here's a simplified representation:

```javascript
{
  "books": [
    {
      "title": "The Catcher in the Rye",
      "author": "J.D. Salinger",
      "genre": "Fiction",
      "description": "A classic novel about teenage angst."
    },
    {
      "title": "To Kill a Mockingbird",
      "author": "Harper Lee",
      "genre": "Fiction",
      "description": "A poignant tale of racial injustice in the American South."
    },
    {
      "title": "The Great Gatsby",
      "author": "F. Scott Fitzgerald",
      "genre": "Fiction",
      "description": "A vivid portrayal of the American Dream in the 1920s."
    }
  ]
}

```

### **Performing Full-Text Search**

Now, let's say we want to find all books that discuss the theme of "American Dream." A traditional search might struggle with this task.

However, with full-text search capabilities we will receive result as :&#x20;

**Search Query:** "American Dream"

```javascript
{
  "results": [
    {
      "title": "The Great Gatsby",
      "author": "F. Scott Fitzgerald",
      "genre": "Fiction",
      "description": "A vivid portrayal of the American Dream in the 1920s."
    }
  ]
}

```

## Understand full-text search in detail

* [<mark style="color:blue;">**How does indexing work in full-text search ?**</mark>](https://docs.cosmocloud.io/resources/document-search/full-text-search/concepts/indexing-in-full-text-search)
* [<mark style="color:blue;">**How data is processed using Analyzers ?**</mark> ](https://docs.cosmocloud.io/resources/document-search/full-text-search/concepts/data-processing-using-analyzers)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cosmocloud.io/resources/document-search/full-text-search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
