lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajnish Kamboj <rajnis...@gmail.com>
Subject Lucene parsing overhead VS directly creating queries?
Date Fri, 14 Oct 2016 14:35:49 GMT
Hi

Is there any performance gain of writing Lucene queries (query objects)
rather than parsing Lucene query strings using QueryParser. I believe
parser has its own overhead.

Example:
Term lTerm1 = new Term("rs", "9971000001");
Term uTerm1 = new Term("rs", "9971000004");
TermRangeQuery trQuery1 = new TermRangeQuery("rs", lTerm1.bytes(),
uTerm1.bytes(), true, true);

VS

Parsing the below string using QueryParser and then perform search.
Query q = new QueryParser("def", analyzer).parse("rs:[9971000001 TO
9971000004]");



-- 
Rajnish

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message