approxmatch

Purpose

The function is used to fuzzy phrase search.

Syntax

approxmatch(term)

Arguments

The function accepts single argument.

The function also accepts the following optional named parameters:

  • order:=yes/no searches taking into account the order of tokens in a source phrase. Default value is set to no.

  • skip_pos skips the specified part of speech within the argument.

  • sentence:=yes/no limits a search to a sentence. Default value is set to no.

  • max_distance specifies a maximal distance from first to last token.

  • skip_class specifies the name of a word-class or a stop-word class (skip_class:=stop) which are ignored when searching.

  • skip_words specifies words ignored when searching.

  • unique:=yes|no searches only unique or non-unique tokens. Default value is set to no.

  • match:=range matches the whole range of the listed arguments.

Returned Value

Documents matching the query.

Examples

approxmatch("customer service", max_distance:=3, sentence:=yes) matches the words "customer" and "service" within a sentence at a maximum distance of 3 tokens, e.g. "Customer service is great", "We perform oil and filter service per customer request", "Customer requests basic service".

approxmatch("southwest from Australia", skip_pos:=particle, max_distance:=7, sentence:=yes) skips the particle "from" and matches phrases "southwest Australia" or "Australia southwest" within a sentence at a maximum distance of 7 tokens.

synonym(approxmatch("southwest from Australia"), skip_pos:=particle, max_distance:=7, sentence:=yes) matches "Australia southwest", "southwest of Australia" and "south-west somewhere in Australia" as the query skips the particle "from" and searches for synonyms of the words "Australia" or "southwest" within a sentence at a maximum distance of 7 tokens.