Package org.apache.solr.handler.component

Examples of org.apache.solr.handler.component.FieldFacetStats


      }
      catch (IOException e) {
        throw new RuntimeException( "failed to open field cache for: "
          + facetField, e );
      }
      facetStats.add(new FieldFacetStats(facetField, facetTermsIndex, facetFieldType, nTerms, ft));
    }
   
   
    DocIterator iter = docs.iterator();
    while (iter.hasNext()) {
View Full Code Here


        si = FieldCache.DEFAULT.getStringIndex(searcher.getReader(), f);
      }
      catch (IOException e) {
        throw new RuntimeException("failed to open field cache for: " + f, e);
      }
      finfo[i] = new FieldFacetStats(f, si, facet_ft, numTermsInField);
      i++;
    }

    final int[] index = this.index;
    final int[] counts = new int[numTermsInField];//keep track of the number of times we see each word in the field for all the documents in the docset
View Full Code Here

      si = FieldCache.DEFAULT.getStringIndex(searcher.getReader(), fieldName);
    }
    catch (IOException e) {
      throw new RuntimeException( "failed to open field cache for: "+fieldName, e );
    }
    FieldFacetStats all = new FieldFacetStats( "all", si, ft, 0 );
    StatsValues allstats = new StatsValues();
    if ( all.nTerms <= 0 || docs.size() <= 0 ) return allstats.getStatsValues();

    // don't worry about faceting if the no documents match...
    int i=0;
    final FieldFacetStats[] finfo = new FieldFacetStats[facet.length];
    for( String f : facet ) {
      ft = searcher.getSchema().getFieldType(f);
      try {
        si = FieldCache.DEFAULT.getStringIndex(searcher.getReader(), f);
      }
      catch (IOException e) {
        throw new RuntimeException( "failed to open field cache for: "+f, e );
      }
      finfo[i++] = new FieldFacetStats( f, si, ft, 0 );
    }
   
   
    DocIterator iter = docs.iterator();
    while (iter.hasNext()) {
      int docID = iter.nextDoc();
      String raw = all.getTermText(docID);
      Double v = null;
      if( raw != null ) {
        v = Double.parseDouble( all.ft.indexedToReadable(raw) );
        allstats.accumulate( v );
      }
View Full Code Here

        si = FieldCache.DEFAULT.getStringIndex(searcher.getReader(), f);
      }
      catch (IOException e) {
        throw new RuntimeException("failed to open field cache for: " + f, e);
      }
      finfo[i] = new FieldFacetStats(f, si, facet_ft, numTermsInField);
      i++;
    }

    final int[] index = this.index;
    final int[] counts = new int[numTermsInField];//keep track of the number of times we see each word in the field for all the documents in the docset
View Full Code Here

      si = FieldCache.DEFAULT.getStringIndex(searcher.getReader(), fieldName);
    }
    catch (IOException e) {
      throw new RuntimeException( "failed to open field cache for: "+fieldName, e );
    }
    FieldFacetStats all = new FieldFacetStats( "all", si, ft, 0 );
    StatsValues allstats = new StatsValues();
    if ( all.nTerms <= 0 || docs.size() <= 0 ) return allstats.getStatsValues();

    // don't worry about faceting if the no documents match...
    int i=0;
    final FieldFacetStats[] finfo = new FieldFacetStats[facet.length];
    for( String f : facet ) {
      ft = searcher.getSchema().getFieldType(f);
      try {
        si = FieldCache.DEFAULT.getStringIndex(searcher.getReader(), f);
      }
      catch (IOException e) {
        throw new RuntimeException( "failed to open field cache for: "+f, e );
      }
      finfo[i++] = new FieldFacetStats( f, si, ft, 0 );
    }
   
   
    DocIterator iter = docs.iterator();
    while (iter.hasNext()) {
      int docID = iter.nextDoc();
      String raw = all.getTermText(docID);
      Double v = null;
      if( raw != null ) {
        v = Double.parseDouble( all.ft.indexedToReadable(raw) );
        allstats.accumulate( v );
      }
View Full Code Here

TOP

Related Classes of org.apache.solr.handler.component.FieldFacetStats

Copyright © 2018 www.massapicom. 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.