lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "m.harig" <m.ha...@gmail.com>
Subject Re: Read large size index
Date Tue, 30 Jun 2009 05:22:01 GMT

Thanks SImon ,

Example:

  IndexReader open = IndexReader.open("/tmp/testindex/");
    IndexSearcher searcher = new IndexSearcher(open);
    final String fName = "test";

is fName a field like summary , contents??

    TopDocs topDocs = searcher.search(new TermQuery(new Term(fName,
"lucene")),
        Integer.MAX_VALUE);
am getting an error that search(Query,Filter) method not applicable for
search(TermQuery,int)

    FieldSelector selector = new FieldSelector() {
      public FieldSelectorResult accept(String fieldName) {
        return fieldName == fName ? FieldSelectorResult.LOAD
            : FieldSelectorResult.NO_LOAD;
      }

    };

    final int totalHits = topDocs.totalHits;
    ScoreDoc[] scoreDocs = topDocs.scoreDocs;
    for (int i = 0; i < totalHits; i++) {
      Document doc = searcher.doc(scoreDocs[i].doc, selector);
    }


could you please explain the code , please
-- 
View this message in context: http://www.nabble.com/Read-large-size-index-tp24251993p24266289.html
Sent from the Lucene - Java Users mailing list archive at Nabble.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