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

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


    Similarity saved = searcher.getSimilarity();
    try {
      // no norm field (so agnostic to indexed similarity)
      searcher.setSimilarity(new DefaultSimilarity());
      assertHits(new FunctionQuery(
          new TFValueSource("bogus", "bogus", "text", new BytesRef("test"))),
          new float[] { (float)Math.sqrt(3d), (float)Math.sqrt(1d) });
      assertHits(new FunctionQuery(
          new TFValueSource("bogus", "bogus", "string", new BytesRef("bar"))),
          new float[] { 0f, 1f });
    } finally {
      searcher.setSimilarity(saved);
    }
  }
View Full Code Here


    Similarity saved = searcher.getSimilarity();
    try {
      // no norm field (so agnostic to indexed similarity)
      searcher.setSimilarity(new DefaultSimilarity());
      assertHits(new FunctionQuery(
          new TFValueSource("bogus", "bogus", "text", new BytesRef("test"))),
          new float[] { (float)Math.sqrt(3d), (float)Math.sqrt(1d) });
      assertHits(new FunctionQuery(
          new TFValueSource("bogus", "bogus", "string", new BytesRef("bar"))),
          new float[] { 0f, 1f });
    } finally {
      searcher.setSimilarity(saved);
    }
  }
View Full Code Here

TOP

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

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.