Example usage for org.apache.solr.search FunctionQParser parseValueSource

List of usage examples for org.apache.solr.search FunctionQParser parseValueSource

Introduction

In this page you can find the example usage for org.apache.solr.search FunctionQParser parseValueSource.

Prototype

public ValueSource parseValueSource() throws SyntaxError 

Source Link

Document

Parse an individual ValueSource.

Usage

From source file:com.indoqa.solr.spatial.corridor.query.points.AbstractPointsQueryCorridorValueSourceParser.java

License:Apache License

@Override
public ValueSource parse(FunctionQParser fp) throws SyntaxError {
    List<Point> queryPoints = new ArrayList<>();
    String[] queryPointParameters = fp.getParams().getParams("corridor.point");

    for (String queryPointParameter : queryPointParameters) {
        queryPoints.add(this.readPoint(queryPointParameter));
    }/*w  w w  . j a  va 2  s  .  c o  m*/

    ValueSource routeValueSource = fp.parseValueSource();

    return this.createValueSource(queryPoints, routeValueSource);
}

From source file:com.indoqa.solr.spatial.corridor.query.route.AbstractRouteQueryValueSourceParser.java

License:Apache License

@Override
public ValueSource parse(FunctionQParser fp) throws SyntaxError {
    LineString lineString = LineStringUtils.parse(fp.getParam("corridor.route"), fp.getReq().getSearcher());
    ValueSource locationValueSource = fp.parseValueSource();

    return this.createValueSource(lineString, locationValueSource);
}

From source file:com.rzewucki.solr.functions.LengthFunctionParser.java

License:Apache License

/**
 * Parses input as ValueSource object and passes it to
 * LengthFunction object.//  w w w  .jav  a2  s.c o m
 * @param fqp FunctionQParser object to parse input values
 * @return ValueSource object
 * @exception SyntaxError
 * @see FunctionQParser
 */
public ValueSource parse(FunctionQParser fqp) throws SyntaxError {
    ValueSource value = fqp.parseValueSource();

    return new LengthFunction(value);
}