Package org.apache.lucene.queries.function

Examples of org.apache.lucene.queries.function.ValueSource


    SpatialArgs args = new SpatialArgs(operation, shape);
    if (!Double.isNaN(distErrPct))
      args.setDistErrPct(distErrPct);

    if (score) {
      ValueSource valueSource = strategy.makeDistanceValueSource(shape.getCenter());
      return new CustomScoreQuery(strategy.makeQuery(args), new FunctionQuery(valueSource));
    } else {
      //strategy.makeQuery() could potentially score (isn't well defined) so instead we call
      // makeFilter() and wrap
View Full Code Here


    if (limit <= 0)
      limit = MAX_N;

    IndexSearcher indexSearcher = new IndexSearcher(indexReader);
    Point pt = shape.getCenter();
    ValueSource valueSource = strategy.makeDistanceValueSource(pt);// the
                                    // distance
                                    // (in
                                    // degrees)
    Sort distSort = new Sort(valueSource.getSortField(false))
        .rewrite(indexSearcher);
    SpatialArgs args = new SpatialArgs(operation, shape);
    args.setDistErr(0.0);
    Filter filter = strategy.makeFilter(args);
    TopDocs docs = indexSearcher.search(new MatchAllDocsQuery(), filter,
View Full Code Here

TOP

Related Classes of org.apache.lucene.queries.function.ValueSource

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.