Package org.apache.lucene.queries.function.valuesource

Examples of org.apache.lucene.queries.function.valuesource.BytesRefFieldSource


  private AbstractAllGroupsCollector<?> createAllGroupsCollector(AbstractFirstPassGroupingCollector<?> firstPassGroupingCollector,
                                                              String groupField) {
    if (firstPassGroupingCollector.getClass().isAssignableFrom(TermFirstPassGroupingCollector.class)) {
      return new TermAllGroupsCollector(groupField);
    } else {
      ValueSource vs = new BytesRefFieldSource(groupField);
      return new FunctionAllGroupsCollector(vs, new HashMap<>());
    }
  }
View Full Code Here


    }
  }
 
  public void testIf() throws Exception {
    assertHits(new FunctionQuery(new IfFunction(
        new BytesRefFieldSource("id"),
        new ConstValueSource(1.0f),
        new ConstValueSource(2.0f)
        )),
        new float[] { 1f, 1f });
    // true just if a value exists...
View Full Code Here

  }

  private GroupingSearch createRandomGroupingSearch(String groupField, Sort groupSort, int docsInGroup, boolean canUseIDV) {
    GroupingSearch groupingSearch;
    if (random().nextBoolean()) {
      ValueSource vs = new BytesRefFieldSource(groupField);
      groupingSearch = new GroupingSearch(vs, new HashMap<>());
    } else {
      groupingSearch = new GroupingSearch(groupField);
    }
View Full Code Here

      final FunctionValues ids = new LongFieldSource("id").getValues(null, leave);
      final ValueSource vs;
      switch (type) {
        case BINARY:
        case SORTED:
          vs = new BytesRefFieldSource("dv");
          break;
        case NUMERIC:
          vs = new LongFieldSource("dv");
          break;
        default:
View Full Code Here

  @SuppressWarnings({"unchecked","rawtypes"})
  private AbstractAllGroupHeadsCollector<?> createRandomCollector(String groupField, Sort sortWithinGroup, boolean canUseIDV, DocValuesType valueType) {
    AbstractAllGroupHeadsCollector<? extends AbstractAllGroupHeadsCollector.GroupHead> collector;
    if (random().nextBoolean()) {
      ValueSource vs = new BytesRefFieldSource(groupField);
      collector =  new FunctionAllGroupHeadsCollector(vs, new HashMap<>(), sortWithinGroup);
    } else {
      collector =  TermAllGroupHeadsCollector.create(groupField, sortWithinGroup);
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.queries.function.valuesource.BytesRefFieldSource

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.