Esempio n. 1
0
 private static final int[] computeMultivaluedTD(
     ReaderAbstract reader,
     String fieldName,
     FieldCacheIndex stringIndex,
     DocIdInterface docIdInterface)
     throws IOException, SearchLibException {
   int[] countIndex = new int[stringIndex.lookup.length];
   int indexPos = 0;
   if (docIdInterface.getSize() == 0) return countIndex;
   int[] docs = new int[100];
   int[] freqs = new int[100];
   BitSetInterface bitset = docIdInterface.getBitSet();
   Term oTerm = new Term(fieldName);
   for (String term : stringIndex.lookup) {
     if (term != null) {
       Term t = oTerm.createTerm(term);
       TermDocs termDocs = reader.getTermDocs(t);
       int l;
       while ((l = termDocs.read(docs, freqs)) > 0)
         for (int i = 0; i < l; i++)
           if (freqs[i] > 0) if (bitset.get(docs[i])) countIndex[indexPos]++;
       termDocs.close();
     }
     indexPos++;
   }
   return countIndex;
 }