MatchPhraseQuery specifies the configurations of a match phrase query. You can use match phrase query to query data in a table based on approximate matches. Match phrase query evaluates the positions of tokens. A row meets the query condition only when the order and positions of the tokens in the row match the order and positions of the tokens that are contained in the keyword.
Data structure
message MatchPhraseQuery {
optional string field_name = 1;
optional string text = 2;
optional float weight = 3;
}
Parameter | Type | Required | Description |
field_name | string | Yes | The name of the column that you want to query. You can perform match phrase queries on TEXT columns. |
text | string | Yes | The keyword that is used to match the value of the column when you perform a match phrase query. If the column that you want to query is of the TEXT type, the keyword is tokenized into multiple tokens based on the analyzer type that you specify when you create the search index. By default, single-word tokenization is performed if you do not specify the analyzer type when you create the search index. For example, if you perform a match phrase query by using the phrase "this is", "..., this is tablestore" and "this is a table" are returned. "this table is ..." or "is this a table" is not returned. |
weight | float | No | The weight configurations of the query condition. |