public abstract class DecayFunctionParser extends Object implements ScoreFunctionParser
{
"fieldname1" : {
"origin" = "someValue",
"scale" = "someValue"
}
"origin" here refers to the reference point and "scale" to the level of
uncertainty you have in your origin.
For example, you might want to retrieve an event that took place around the 20 May 2010 somewhere near Berlin. You are mainly interested in events that are close to the 20 May 2010 but you are unsure about your guess, maybe it was a week before or after that. Your "origin" for the date field would be "20 May 2010" and your "scale" would be "7d". This class parses the input and creates a scoring function from the parameters origin and scale.
To write a new scoring function, create a new class that inherits from this
one and implement the getDistanceFunction(). Furthermore, to create a builder,
override the getName() in DecayFunctionBuilder.
See GaussDecayFunctionBuilder and GaussDecayFunctionParser
for an example. The parser furthermore needs to be registered in the
ScoreFunctionParserMapper.
| 修飾子とタイプ | クラスと説明 |
|---|---|
static class |
DecayFunctionParser.AbstractDistanceScoreFunction
This is the base class for scoring a single field.
|
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static ParseField |
MULTI_VALUE_MODE |
| コンストラクタと説明 |
|---|
DecayFunctionParser() |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
abstract DecayFunction |
getDecayFunction()
Override this function if you want to produce your own scorer.
|
ScoreFunction |
parse(QueryParseContext parseContext,
XContentParser parser)
Parses bodies of the kind
{
"fieldname1" : {
"origin" = "someValue",
"scale" = "someValue"
}
}
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamespublic static final ParseField MULTI_VALUE_MODE
public abstract DecayFunction getDecayFunction()
public ScoreFunction parse(QueryParseContext parseContext, XContentParser parser) throws IOException, QueryParsingException
{
"fieldname1" : {
"origin" = "someValue",
"scale" = "someValue"
}
}
parse インタフェース内 ScoreFunctionParserIOExceptionQueryParsingExceptionCopyright © 2009–2016. All rights reserved.