Created
May 11, 2016 07:30
-
-
Save chaitanyamannem/c366bbaae3fca7805fdcb5ea0f0b491f to your computer and use it in GitHub Desktop.
Parser class to parse the arguments of custom solr function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.solrExample.solr4; | |
import org.apache.lucene.queries.function.ValueSource; | |
import org.apache.solr.search.FunctionQParser; | |
import org.apache.solr.search.SyntaxError; | |
import org.apache.solr.search.ValueSourceParser; | |
/** | |
* | |
* Created May 10, 2016 2:52:25 PM | |
* @author chaitanya | |
*/ | |
public class AvailabilityParser extends ValueSourceParser { | |
@Override | |
public ValueSource parse(FunctionQParser fp) throws SyntaxError { | |
String startDateTime = fp.parseArg(); | |
String endDateTime = fp.parseArg(); | |
String fieldName = fp.parseArg(); | |
return new AvailabilityValueSource(startDateTime, endDateTime, fieldName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment