Search in sources :

Example 6 with Field

use of io.github.ihongs.dh.search.StatisHandle.Field in project HongsCORE by ihongs.

the class StatisHelper method amount.

private int amount(Map rd, IndexSearcher finder, Map<String, Map<Range, Ratio>> counts, Map<String, Set<Range>> countx) throws HongsException {
    Field[] fields = getGraderFields(counts.keySet(), rd);
    try {
        Query q = that.padQry(rd);
        if (4 == (4 & Core.DEBUG)) {
            CoreLogger.debug("StatisHelper.amount: " + q.toString());
        }
        if (counts.isEmpty()) {
            return finder.count(q);
        }
        StatisGrader.Amount c = new StatisGrader.Amount(fields, counts, countx);
        finder.search(q, c);
        return c.count();
    } catch (IOException e) {
        throw new HongsException(e);
    }
}
Also used : Field(io.github.ihongs.dh.search.StatisHandle.Field) Query(org.apache.lucene.search.Query) HongsException(io.github.ihongs.HongsException) IOException(java.io.IOException)

Aggregations

Field (io.github.ihongs.dh.search.StatisHandle.Field)6 HongsException (io.github.ihongs.HongsException)4 IOException (java.io.IOException)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 Query (org.apache.lucene.search.Query)3 HashSet (java.util.HashSet)2 Set (java.util.Set)2 MatchAllDocsQuery (org.apache.lucene.search.MatchAllDocsQuery)2 TYPE (io.github.ihongs.dh.search.StatisHandle.TYPE)1 ArrayList (java.util.ArrayList)1 IndexSearcher (org.apache.lucene.search.IndexSearcher)1