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.

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:

{
  "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."
    }
  ]
}

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 :

Search Query: "American Dream"

{
  "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

Last updated