I have this search code that is quite bugging me,
if(webSafeCursor != null && !webSafeCursor.isEmpty()){
Cursor cursor = Cursor.newBuilder().build(webSafeCursor);
QueryOptions options = QueryOptions.newBuilder()
.setLimit(10)
.setFieldsToSnippet("content")
.setCursor(cursor)
.build();
query = Query.newBuilder()
.setOptions(options)
.build(queryString);
}
Results<ScoredDocument> results = null;
if(query != null){
results = index.search(query);
} else {
results = index.search(queryString);
}
results.getCursor(); // NULL!
}
The problem here is that the results
returned is 20 items while it is clear in the QueryOptions
that the limit is 10.
What could be wrong in this code?
And another thing is the query result do not emit a Cursor, whereas it is clear (by manually checking) that the query should return more than 20 items, and that should return a Cursor? Or is this the correct behavior?