Skip to content

Commit

Permalink
Propagating Fulltext Limits to Cottontail (#312)
Browse files Browse the repository at this point in the history
Former-commit-id: 015744e
  • Loading branch information
silvanheller authored May 17, 2022
1 parent e9b5592 commit 5151fad
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,14 @@ private List<Map<String, PrimitiveTypeProvider>> getRowsHelper(String fieldName,
public List<Map<String, PrimitiveTypeProvider>> getFulltextRows(int rows, String fieldname, ReadableQueryConfig queryConfig, String... terms) {
/* Prepare plain query. */
final String predicate = Arrays.stream(terms).map(String::trim).collect(Collectors.joining(" OR "));

/* TODO Cottontail calls this a distance in its documentation, but it's actually a score. See the tests - that's why we order DESC and not ASC */
final Query query = new Query(this.fqn)
.select("*", null)
.fulltext(fieldname, predicate, DB_DISTANCE_VALUE_QUALIFIER)
.queryId(generateQueryID("ft-rows", queryConfig));
.queryId(generateQueryID("ft-rows", queryConfig))
.order(DB_DISTANCE_VALUE_QUALIFIER, Direction.DESC)
.limit(rows);


/* Process predicates. */
Expand Down

0 comments on commit 5151fad

Please sign in to comment.