Example usage for org.apache.solr.search SolrIndexSearcher collectionStatistics

List of usage examples for org.apache.solr.search SolrIndexSearcher collectionStatistics

Introduction

In this page you can find the example usage for org.apache.solr.search SolrIndexSearcher collectionStatistics.

Prototype

@Override
    public CollectionStatistics collectionStatistics(String field) throws IOException 

Source Link

Usage

From source file:org.alfresco.solr.query.AbstractAuthorityQueryWeight.java

License:Open Source License

public AbstractAuthorityQueryWeight(SolrIndexSearcher searcher, boolean needsScores, Query query,
        String authTermName, String authTermText) throws IOException {
    super(query);
    this.searcher = searcher;
    //this.similarity = (TFIDFSimilarity) searcher.getSimilarity(true);
    CollectionStatistics collectionStats = searcher.collectionStatistics(authTermName);
    final IndexReaderContext context = searcher.getTopReaderContext();
    final Term term = new Term(authTermName, authTermText);
    final TermContext termContext = TermContext.build(context, term);
    TermStatistics termStats = searcher.termStatistics(term, termContext);
    //idfExp = similarity.idfExplain(collectionStats, termStats);
    //idf = idfExp.getValue();
    this.needsScores = needsScores;
}