Package org.apache.lucene.search

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


            if (states[i]) {
                out.writeString((String) keys[i]);
                CollectionStatistics statistics = (CollectionStatistics) values[i];
                assert statistics.maxDoc() >= 0;
                out.writeVLong(statistics.maxDoc());
                out.writeVLong(addOne(statistics.docCount()));
                out.writeVLong(addOne(statistics.sumTotalTermFreq()));
                out.writeVLong(addOne(statistics.sumDocFreq()));
            }
        }
    }
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.