MATCH_PHRASE
Description
This function can only be used on columns that have an inverted index built. Based on match_all, the order of the matching results must be consistent and continuous with the query tokenization results, ignoring case. Then, the query is constructed based on the tokenization, and the final query results are returned. For example, if the query string is "Microsoft Azure Party", the analyzer tokenizes it into three lowercase words: microsoft, azure, and party. Then, a boolean query is constructed based on the analysis results. By default, the query logic executed internally by the engine is: as long as the eventname field value contains all of microsoft, azure, or party, and the order is microsoft, azure, or party, then that row of data is returned.
Parameter Description
- inverted_column: The column used to build the inverted index.
- query: The text string you want to search for.
- option: This parameter is required to specify the tokenization settings. It must use the same tokenization method as the column used to build the inverted index. The
autoparameter is supported, which will automatically match the tokenization settings ininverted_column, for example:map('analyzer', 'auto').
Return Result
boolean type
Example
- Example One
- Query data containing 'Elfriede Heaney', requiring both words in order and consecutive:
