phrase

Purpose

Finds documents that contain arguments adjacent to each other in a specified order within a sentence.

Syntax

phrase([distance,] term_1, term_2,..)

Arguments

The function accepts several arguments:

  • The first optional argument distance is used to specify maximum distance (in tokens) between adjacent arguments. By default, the argument value is set to 1. If the argument value is set to 0, punctuation between arguments is not allowed.

  • The other arguments define the terms to search for.

The function also supports optional named parameters:

  • allow_punct:=yes/no allows or prohibits punctuation between arguments (set to "yes" by default).

  • allow_space:=yes/no allows or prohibits spaces between arguments (set to "yes" by default).

  • match:=range matches text range starting from the first found term and ending with the last found term.

  • match:=inverse matches text range starting from the first found term and ending with the last found term except for the specified arguments.

Returned Value

Documents matching the query.

Examples

phrase(company, product) = phrase(1, company, product) matches «the Company’s products» and «companies, products or technologies».

phrase(0, company, product) = phrase(company, product, allow_punct:=no) = phrase(1, company, product, allow_punct:=no) matches «the Company’s products» but not «companies, products or technologies».

phrase("11", "12", "2017", allow_space:=no) matches «11/12/2017», but not «11 / 12 / 2017».