lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Lucene search optimization
Date Wed, 31 May 2006 17:30:49 GMT

: public CompassHits find(String query) throws CompassException {
:         return createQueryBuilder().queryString(query).toQuery().hits();
:     }
: And all of these objects are pure wrappers around lucene equivalents,
: nothing more.

: 2) What I am timing is only the find call :
: -- start timer
: CompassHits hits = compassSession.find("cityName:"+ name+"~");
: -- stop timer

ok, but a thin wrapper arround *which* lucene equivilents? .. there are
many different methods for doing a search in lucene, each with a different
usage pattern and performance characteristics ... if for example that code
uses a HitCollector and just pulls back the IDs into the CompassHits
that's going to be faster then if it gets a Hits obejct and then iterates
over each Hit storing the full Document in the CompassHits object --
especially if you've got more then 50 or so results ... in which case
using a Hits object will acctaully result in your search being executed
again and again as you iterate farther down the list of results.

exactly what those methods do can make a big difference.

then again: maybe they don't,  maybe fuzzy queries really are that slow (i
don't know, i've never used them) I just want to make sure you think about
those issues.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message