matchPhrase

fun matchPhrase(matchPhrase: String, field: String = "_all", analyzer: String? = null): SearchQuery

A Match Phrase query

Analyzes matchPhrase and uses the result to search for terms in the target that occur in the same order and position.

The target field must be indexed with "include term vectors".

Similar queries

If you want exact matches without analysis, use phrase.

If the order and proximity of the terms are not significant, use match.

Parameters

matchPhrase

The input string to analyze and match against.

analyzer

Analyzer to apply to matchPhrase. Defaults to the analyzer set for field during index creation.

field

The field to search. Defaults to _all, whose content is specified during index creation.