lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markharw00d <markharw...@yahoo.co.uk>
Subject Re: Vedr. Re: Design question [too many fields?]
Date Wed, 29 Jun 2005 19:15:46 GMT
I suspect the most performant is as follows (but could require bags of 
RAM) :
Heres the pseudo code .....

[on IndexReader open, initialize map]
int []luceneDocIdsByDbKey=new int [largestDbKey]; //could be large array!
for (int i=0;i;<reader.maxDocs;i++)
{
    int dbKey=Integer.parseInt(reader.doc(i).get("dbKey"));
    luceneDocIdsByDbKey[dbKey]=i;
}

[on search, use map]
results=dbConn.executeQuery(select dbKey from db where ........)
BitSet bits=new BitSet(reader.maxDocs);
for( all dbKey in resultset)
{
    bits.set(luceneDocIdsByDbKey[dbKey];
}
MyBitSetFilter filter=new MyBitSetFilter(bits);

Should be super-quick but requires (int size* num db records) memory for 
the map.


Cheers
Mark

	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message