lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sariny" <>
Subject How to Cache Filter Results between Servers
Date Mon, 29 Nov 2010 03:50:34 GMT
hello everyone

	    I have this test code:

		IndexReader ir = getReader(); 
        TermQuery q = new TermQuery(new Term("sub_id",NumericUtils.intToPrefixCoded(57)));
        Filter f = new QueryWrapperFilter(q);
            DocIdSet s = f.getDocIdSet(ir);

            DocIdSetIterator i = s.iterator();
            while(i.nextDoc() != DocIdSetIterator.NO_MORE_DOCS)

        catch (IOException e)

       1. getReader() returns a MultiReader may consist of  several IndexReaders, in my test
case ,only consist of one IndexReader
	   2. index files won't change 

	  assuming that index files won't be updated, and my question is : 
 	  1. why ir.hashCode() returns different value every time I run this code?
      2. if I copy the index file to another server ,and they provide search service together,will
f.getDocIdSet(ir) return the same DocIdSet? if true,how to cache filter results and share
between the 2 servers?  how to form a cache key not influenced by question 1?

	  Thanks ~~


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

View raw message