Package org.apache.lucene.facet.search

Examples of org.apache.lucene.facet.search.FacetArrays


  public SortedSetDocValuesAccumulator(SortedSetDocValuesReaderState state, FacetSearchParams fsp, FacetArrays arrays)
      throws IOException {
    super(fsp);
    this.state = state;
    this.field = state.getField();
    this.facetArrays = arrays == null ? new FacetArrays(state.getSize()) : arrays;
    dv = state.getDocValues();

    // Check params:
    for (FacetRequest fr : fsp.facetRequests) {
      if (!(fr instanceof CountFacetRequest)) {
View Full Code Here


  private Object accumulateGuard;

  private double complementThreshold = DEFAULT_COMPLEMENT_THRESHOLD;
 
  private static FacetArrays createFacetArrays(FacetSearchParams searchParams, TaxonomyReader taxoReader) {
    return new FacetArrays(PartitionsUtils.partitionSize(searchParams.indexingParams, taxoReader));
  }
View Full Code Here

public class TestFacetArrays extends LuceneTestCase {

  @Test
  public void testSimple() {
    FacetArrays arrays = new FacetArrays(new IntArrayAllocator(1, 1), new FloatArrayAllocator(1, 1));

    int[] intArray = arrays.getIntArray();
    // Set the element, then free
    intArray[0] = 1;
    arrays.free();

    // We should expect a cleared array back
    intArray = arrays.getIntArray();
    assertEquals("Expected a cleared array back, but the array is still filled", 0, intArray[0]);

    float[] floatArray = arrays.getFloatArray();
    // Set the element, then free
    floatArray[0] = 1.0f;
    arrays.free();

    // We should expect a cleared array back
    floatArray = arrays.getFloatArray();
    assertEquals("Expected a cleared array back, but the array is still filled", 0.0f, floatArray[0], 0.0);
  }
View Full Code Here

  public SortedSetDocValuesAccumulator(SortedSetDocValuesReaderState state, FacetSearchParams fsp, FacetArrays arrays)
      throws IOException {
    super(fsp);
    this.state = state;
    this.field = state.getField();
    this.facetArrays = arrays == null ? new FacetArrays(state.getSize()) : arrays;
    dv = state.getDocValues();

    // Check params:
    for (FacetRequest fr : fsp.facetRequests) {
      if (!(fr instanceof CountFacetRequest)) {
View Full Code Here

  final SortedSetDocValuesReaderState state;
  final SortedSetDocValues dv;
  final String field;

  public SortedSetDocValuesAccumulator(FacetSearchParams fsp, SortedSetDocValuesReaderState state) throws IOException {
    super(fsp, null, null, new FacetArrays(state.getSize()));
    this.state = state;
    this.field = state.getField();
    dv = state.getDocValues();

    // Check params:
View Full Code Here

  // based on that.
  private final FacetsAccumulator accumulator;
  private final RangeAccumulator rangeAccumulator;

  public static FacetsAccumulator create(FacetSearchParams fsp, IndexReader indexReader, TaxonomyReader taxoReader) {
    return create(fsp, indexReader, taxoReader, new FacetArrays(taxoReader.getSize()));
  }
View Full Code Here

       
        this.searchParams = searchParams;
        this.taxonomyReader = taxonomyReader;
       
//        this.facetArrays = new FacetArrays(taxonomyReader.getSize());
        this.facetArrays = new FacetArrays(
                PartitionsUtils.partitionSize(searchParams.indexingParams, taxonomyReader));
       
        docbits = new DefaultDocumentSet(1031);//docs.getDocumentCount());
        //docbits = new FixedBitSet(docs.getDocumentCount());
View Full Code Here

  final SortedSetDocValuesReaderState state;
  final SortedSetDocValues dv;
  final String field;

  public SortedSetDocValuesAccumulator(FacetSearchParams fsp, SortedSetDocValuesReaderState state) throws IOException {
    super(fsp, null, null, new FacetArrays((int) state.getDocValues().getValueCount()));
    this.state = state;
    this.field = state.getField();
    dv = state.getDocValues();

    // Check params:
View Full Code Here

TOP

Related Classes of org.apache.lucene.facet.search.FacetArrays

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.