use of io.crate.expression.symbol.MatchPredicate in project crate by crate.
the class SelectStatementAnalyzerTest method testSelectWhereSimpleMatchPredicate.
@Test
public void testSelectWhereSimpleMatchPredicate() throws Exception {
var executor = SQLExecutor.builder(clusterService).addTable(TableDefinitions.USER_TABLE_DEFINITION).build();
QueriedSelectRelation relation = executor.analyze("select * from users where match (text, 'awesome')");
assertThat(relation.where(), instanceOf(MatchPredicate.class));
MatchPredicate query = (MatchPredicate) relation.where();
assertThat(query.identBoostMap(), hasEntry(isReference("text"), isLiteral(null)));
assertThat(query.options(), isLiteral(Map.of()));
assertThat(query.queryTerm(), isLiteral("awesome"));
assertThat(query.matchType(), is("best_fields"));
}
Aggregations