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

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

Introduction

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

Prototype

public int parseInt() throws SyntaxError 

Source Link

Document

Parse an integer

Usage

From source file:org.vootoo.search.function.RandomValueSourceParser.java

License:Apache License

@Override
public ValueSource parse(FunctionQParser fp) throws SyntaxError {
    int max = Integer.MAX_VALUE;
    Long seed = null;/*from w  w  w  .j  ava 2s  .c  o  m*/
    if (fp.hasMoreArguments()) {
        max = fp.parseInt();
    }
    if (fp.hasMoreArguments()) {
        seed = parseLong(fp);
    }
    return new RandomValueSource(max, seed);
}