Querylight TS Demo

Phrase Search and Slop

Match analyzed terms in sequence, with optional movement tolerance.

Back to docs search

Reference Entry

Phrase Search and Slop

Lexical Querying · querying · order 30

Match analyzed terms in sequence, with optional movement tolerance.

Phrase Search and Slop

MatchPhrase checks whether analyzed terms occur in order.

Exact phrase

import { MatchPhrase } from "@tryformation/querylight-ts";

const exact = new MatchPhrase({ field: "body", text: "vector search" });

Phrase with slop

Slop allows nearby terms to count even when there is a little distance between them.

const tolerant = new MatchPhrase({ field: "body", text: "portable json index state", slop: 2, boost: 2.0 });

Good queries to try in the demo

  • "portable json index state"
  • "vector search"
  • "phrase search"

Learn more