List of usage examples for org.apache.solr.search SolrIndexSearcher collectionStatistics
@Override
public CollectionStatistics collectionStatistics(String field) throws IOException
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; }