Examples of docCount()


Examples of org.apache.lucene.search.CollectionStatistics.docCount()

  }

  public static void fieldShouldExistInIndex(IndexSearcher searcher, String field) throws IOException {
    CollectionStatistics idFieldStatistics = searcher.collectionStatistics(field);
    if (idFieldStatistics.docCount() == 0) {
      throw new IllegalArgumentException("Field '" + field + "' does not exist in the index");
    }
  }

}
View Full Code Here

Examples of org.elasticsearch.search.lookup.IndexField.docCount()

        IndexField indexField = indexLookup().get(field);
        for (int i = 0; i < terms.length; i++) {
            IndexFieldTerm indexFieldTerm = indexField.get(terms[i]);
            try {
                if (indexFieldTerm.tf() != 0) {
                    score += indexFieldTerm.tf() * indexField.docCount() / indexFieldTerm.df();
                }
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
View Full Code Here

Examples of uk.ac.ucl.panda.indexing.io.IndexWriter.docCount()

         writer.addDocument(doc);// add Document to index   
       }

   
   
    int numIndexed = writer.docCount();
    writer.optimize();
    writer.close();
                long end = new Date().getTime();
    System.out.println("Indexing " + numIndexed + " files took " + (end - start)+ " milliseconds");
                ExtraInformation EI= new ExtraInformation(index, field);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.