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

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


    assertHits(new FunctionQuery(new ByteFieldSource("byte")),
        new float[] { 5f, 12f });
  }
 
  public void testConst() throws Exception {
    assertHits(new FunctionQuery(new ConstValueSource(0.3f)),
        new float[] { 0.3f, 0.3f });
  }
View Full Code Here


        new float[] { 0.3f, 0.3f });
  }
 
  public void testDiv() throws Exception {
    assertHits(new FunctionQuery(new DivFloatFunction(
        new ConstValueSource(10f), new ConstValueSource(5f))),
        new float[] { 2f, 2f });
  }
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...
    assertHits(new FunctionQuery(new IfFunction(
        new LiteralValueSource("false"),
        new ConstValueSource(1.0f),
        new ConstValueSource(2.0f)
        )),
        new float[] { 1f, 1f });
  }
View Full Code Here

    assertHits(new FunctionQuery(new JoinDocFreqValueSource("string", "text")),
        new float[] { 2f, 0f });
  }
 
  public void testLinearFloat() throws Exception {
    assertHits(new FunctionQuery(new LinearFloatFunction(new ConstValueSource(2.0f), 3, 1)),
        new float[] { 7f, 7f });
  }
View Full Code Here

        new float[] { 2f, 2f });
  }
 
  public void testMaxFloat() throws Exception {
    assertHits(new FunctionQuery(new MaxFloatFunction(new ValueSource[] {
        new ConstValueSource(1f), new ConstValueSource(2f)})),
        new float[] { 2f, 2f });
  }
View Full Code Here

        new float[] { 2f, 2f });
  }
 
  public void testMinFloat() throws Exception {
    assertHits(new FunctionQuery(new MinFloatFunction(new ValueSource[] {
        new ConstValueSource(1f), new ConstValueSource(2f)})),
        new float[] { 1f, 1f });
  }
View Full Code Here

        new float[] { 2f, 2f });
  }
 
  public void testPow() throws Exception {
    assertHits(new FunctionQuery(new PowFloatFunction(
        new ConstValueSource(2f), new ConstValueSource(3f))),
        new float[] { 8f, 8f });
  }
View Full Code Here

        new float[] { 8f, 8f });
  }
 
  public void testProduct() throws Exception {
    assertHits(new FunctionQuery(new ProductFloatFunction(new ValueSource[] {
        new ConstValueSource(2f), new ConstValueSource(3f)})),
        new float[] { 6f, 6f });
  }
View Full Code Here

        new float[] { 6f, 6f });
  }
 
  public void testQuery() throws Exception {
    assertHits(new FunctionQuery(new QueryValueSource(
        new FunctionQuery(new ConstValueSource(2f)), 0f)),
        new float[] { 2f, 2f });
  }
View Full Code Here

        5, 6, 1, 0f)),
        new float[] { 1f, 0f });
  }
 
  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

TOP

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

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.