Documentation
¶
Overview ¶
Package ftsquery is the one place the platform's full-text searches build the tsquery they match a caller's words with (#2838).
A search that ranks with an embedding as well (hybrid) matches every word: the vector arm already returns the rows that are near the intent whatever their words, so the lexical arm adds the rows that hold the whole phrase. A search that ranks by words alone (no embedder, or the embedder did not answer in time) matches any word and ranks by how many match and how well: an agent's intent is a sentence, and a sentence whose every word is in one row matches almost nothing, so requiring all of them answered "outbound orders count" with no rows at all.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllWords ¶
AllWords is the tsquery matching rows that hold every word of the text bound at param (a placeholder such as "$2" or "?"): plainto_tsquery, whose lexemes are joined with &.
func AnyWord ¶
AnyWord is the tsquery matching rows that hold at least one word of the text bound at param. It is plainto_tsquery's query with every & made |: the same lexemes, stemmed and stop words removed, by the same configuration. The default parser never puts a space inside a lexeme, so " & " occurs in the query's text only between lexemes (a URL's & is inside its quoted lexeme), and the text form of a tsquery is valid tsquery input. Text of stop words alone gives an empty query, which matches nothing, as plainto_tsquery's does.
Types ¶
This section is empty.