Files
lancedb/docs/src/js/classes/MatchQuery.md
BubbleCal fec8d58f06 feat: support a bunch or FTS features in JS SDK (#2431)
- operator for match query
- slop for phrase query
- boolean query

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced support for boolean full-text search queries with AND/OR
logic and occurrence conditions.
- Added operator options for match and multi-match queries to control
term combination logic.
- Enabled phrase queries to specify proximity (slop) for flexible phrase
matching.
- Added new enumerations (`Operator`, `Occur`) and the `BooleanQuery`
class for enhanced query expressiveness.

- **Bug Fixes**
- Improved validation and error handling for invalid operator and
occurrence inputs in full-text queries.

- **Tests**
- Expanded test coverage with new cases for boolean queries and
operator-based full-text searches.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
2025-06-12 17:04:19 +08:00

1.6 KiB

@lancedb/lancedbDocs


@lancedb/lancedb / MatchQuery

Class: MatchQuery

Represents a full-text query interface. This interface defines the structure and behavior for full-text queries, including methods to retrieve the query type and convert the query to a dictionary format.

Implements

Constructors

new MatchQuery()

new MatchQuery(
   query,
   column,
   options?): MatchQuery

Creates an instance of MatchQuery.

Parameters

  • query: string The text query to search for.

  • column: string The name of the column to search within.

  • options? Optional parameters for the match query.

    • boost: The boost factor for the query (default is 1.0).
    • fuzziness: The fuzziness level for the query (default is 0).
    • maxExpansions: The maximum number of terms to consider for fuzzy matching (default is 50).
    • operator: The logical operator to use for combining terms in the query (default is "OR").
  • options.boost?: number

  • options.fuzziness?: number

  • options.maxExpansions?: number

  • options.operator?: Operator

Returns

MatchQuery

Methods

queryType()

queryType(): FullTextQueryType

The type of the full-text query.

Returns

FullTextQueryType

Implementation of

FullTextQuery.queryType