Examples of ConstValueSource


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

  public void testRangeMap() throws Exception {
    assertHits(new FunctionQuery(new RangeMapFloatFunction(new FloatFieldSource("float"),
        5, 6, 1, 0f)),
        new float[] { 1f, 0f });
    assertHits(new FunctionQuery(new RangeMapFloatFunction(new FloatFieldSource("float"),
        5, 6, new SumFloatFunction(new ValueSource[] {new ConstValueSource(1f), new ConstValueSource(2f)}),
        new ConstValueSource(11f))),
        new float[] { 3f, 11f });
  }
View Full Code Here

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

        new ConstValueSource(11f))),
        new float[] { 3f, 11f });
  }
 
  public void testReciprocal() throws Exception {
    assertHits(new FunctionQuery(new ReciprocalFloatFunction(new ConstValueSource(2f),
        3, 1, 4)),
        new float[] { 0.1f, 0.1f });
  }
View Full Code Here

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

        new float[] { 945f, 123f });
  }
 
  public void testSumFloat() throws Exception {
    assertHits(new FunctionQuery(new SumFloatFunction(new ValueSource[] {
        new ConstValueSource(1f), new ConstValueSource(2f)})),
        new float[] { 3f, 3f });
  }
View Full Code Here

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

    Query q = new MatchAllDocsQuery();
    TopDocs docs = is.search(q, 10);
    assertEquals(1, docs.totalHits);
    float score = docs.scoreDocs[0].score;
   
    Query boostedQ = new BoostedQuery(q, new ConstValueSource(2.0f));
    assertHits(boostedQ, new float[] { score*2 });
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.