Full-Text Search
Full-text search is the default search mode in Orama. It allows you to search for documents based on text content across multiple properties with advanced features like BM25 ranking, typo tolerance, and field boosting.Basic Full-Text Search
The simplest way to perform a full-text search is to provide a search term:Search Response
Full-text search returns a structured response with the following properties:The total number of matched documents
An array of matched documents taking
limit and offset into accountThe time taken to search, with both raw nanoseconds and formatted time
The facets results if facets are enabled
The groups results if grouping is enabled
Search Parameters
term
The search term, sentence, or word to search for:The
term parameter is optional. When omitted, Orama will return all documents or filter based on the where clause.properties
Specify which properties to search in. By default, Orama searches all string properties:limit and offset
Control pagination of search results:mode
Explicitly set the search mode to full-text:The
mode parameter can be MODE_FULLTEXT_SEARCH, MODE_VECTOR_SEARCH, or MODE_HYBRID_SEARCH. When omitted, Orama defaults to full-text search.Advanced Search Options
exact
Perform exact phrase matching (case-sensitive):preflight
Perform a preflight query to get only facets and document count without fetching full documents:Preflight queries are useful for displaying search result counts and facets before loading the full results.
distinctOn
Return only one result per unique value of a specified property:BM25 Relevance Tuning
Orama uses the BM25 algorithm for scoring search results. You can customize the BM25 parameters:Term frequency saturation parameter. Higher values give more importance to term frequency. Should be between 1.2 and 2.0.
Document length saturation impact. Higher values give more importance to document length.
Frequency normalization lower bound.
Performance Considerations
Related Topics
Typo Tolerance
Handle misspellings and typos in search queries
Boosting
Give more importance to specific fields
Filters
Filter search results by property values
Facets
Generate facets for filtering options