lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruslan Sivak <>
Subject optimizing single document searches
Date Tue, 27 Feb 2007 23:25:15 GMT
I am using Lucene in a little bit weird way, instead of searching all 
the documents for a specific query, I am searching a single document for 
many specific queries. 

On a single document of 10k characters, doing about 40k searches takes 
about 5 seconds.  This is not bad, but I was wondering if I can somehow 
speed this up.  It also takes about 5 seconds to generate the 
searchTerms (which is fine, since I will do it once and cache it). 

I'm not sure what information would be needed, but my queries look 
something like this:

"Brooklyn NY"

I am currently using SpanNearQuery with a slop of 0 and inOrder of 
false.  Is there perhaps another type of Query I can use to speed things 
up?  TermQuery doesn't work since I have multiple terms, and PhraseQuery 
seems to take around the same time, and is not compatible with 
SpanNearQuery (I later merge this query with another in a SpanNearQuery). 

I can live without merging this into the SpanNearQuery, as long as I can 
find something that can do the 40k searches faster. 


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

View raw message