Is there a way to use a Query to filter/test against one doc in memory?


(Josh J. Luo) #1

Similar to Lucene's MemoryIndex, for example:

Query query = parseQuery("{'match' : { 'name', 'Trump'}}");
String doc = "{'_source': { 'name': 'Trump'}}";
float score = query.getScore(doc);

if score > 0 it means matched successfully


(system) #2