java - Numeric Query in Luwak Stored Query Engine (query format similar to lucene) -


i using luwak - stored query engine flax (https://github.com/flaxsearch/luwak).

i started couple of queries title:first, title:first , document:text12 etc. similar lucene queries.

but when came number got stuck. tried couple of things number range query still didn't working.

my document looks (json):

{ "title":   "this text first indexed", "document":"this first document.              have test text best , check use case              , or not etc can come in between , nested boolean             expression have check" "upvotes":  1 } 

and queries wanted check are:

  1. title contains word text (was able do)
  2. title contains word text , document contains word first (was able do)
  3. title does not contains word dasds , document does not contains word firsdadsast (was not able do)
  4. upvotes greater than 10 (was not able do)
  5. upvotes equals 10 (was not able do)
  6. and queries title starts with the etc. (was not able do)
  7. also wanted know how can query in case of nested documents.

my program looks this:

    monitor monitor = new monitor(new lucenequeryparser(null), new termfilteredpresearcher());      // first query list mentioned above     monitorquery monitorquery0 = new monitorquery("query0", "title:text");     // second query list mentioned above     monitorquery monitorquery1 = new monitorquery("query1", "title:text , document:first");     // third query list mentioned above     monitorquery monitorquery2 = new monitorquery("query2", "not (title:dasds , document:firsdadsast)");     // fourth query list mentioned above     monitorquery monitorquery3 = new monitorquery("query4", "upvote:[10 *]");     // fourth query list mentioned above (was trying new after googling alot)     monitorquery monitorquery4 = new monitorquery("query5", numericrangequery.newlongrange("upvote", 10l, long.max_value, true, true).tostring());     // sixth query list mentioned above     monitorquery monitorquery5 = new monitorquery("query6", new prefixquery(new term("title", "the")).tostring());      arraylist<monitorquery> monitorquery = new arraylist<monitorquery>();     monitorquery.add(monitorquery0);     monitorquery.add(monitorquery1);     monitorquery.add(monitorquery2);     monitorquery.add(monitorquery3);     monitorquery.add(monitorquery4);     monitorquery.add(monitorquery5);      list<queryerror> errors = monitor.update(monitorquery);      string titlestring = "this text first indexed";     string documentstring = "this first document. " +             "have test text best , check use case " +             "and or not etc can come in between , nested boolean\n expression have check";     inputdocument document = inputdocument.builder("doc1")             .addfield("title", titlestring, new standardanalyzer())             .addfield("document", documentstring, new standardanalyzer())             .addfield(new longfield("upvote", 1, field.store.yes))             .build();      matches<querymatch> matches = monitor.match(document, simplematcher.factory);      (string s : matches.getpresearcherhits()) {         system.out.println("querymatched : " + s);     }      system.out.println("done");      monitor.close(); 

output of above program:

querymatched : query4 querymatched : query5 querymatched : query6 querymatched : query0 querymatched : query1 done 

in output says matched query4, query5 , query6. (but based on condition shouldn't have matched queries @ all)

also if see didn't match query2 though based on condition provided query2 should have matched document.

please help. starting luwak stored query engine. implemented on top of lucene. , think query format lucene , luwak similar.

any grateful.

(sorry! not able tag luwak, because tag doesn't exist , dont have enough reputation create one.)

thanks.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -