Streamline single value with boost queries: Allow for both value and query name to specify the query value, closes #192.
This commit is contained in:
parent
493464ba02
commit
3406e77cec
|
@ -68,7 +68,9 @@ public class PrefixQueryParser extends AbstractIndexComponent implements XConten
|
||||||
if (token == XContentParser.Token.FIELD_NAME) {
|
if (token == XContentParser.Token.FIELD_NAME) {
|
||||||
currentFieldName = parser.currentName();
|
currentFieldName = parser.currentName();
|
||||||
} else if (token.isValue()) {
|
} else if (token.isValue()) {
|
||||||
if (NAME.equals(currentFieldName)) {
|
if ("prefix".equals(currentFieldName)) {
|
||||||
|
value = parser.text();
|
||||||
|
} else if ("value".equals(currentFieldName)) {
|
||||||
value = parser.text();
|
value = parser.text();
|
||||||
} else if ("boost".equals(currentFieldName)) {
|
} else if ("boost".equals(currentFieldName)) {
|
||||||
boost = parser.floatValue();
|
boost = parser.floatValue();
|
||||||
|
|
|
@ -71,7 +71,9 @@ public class SpanTermQueryParser extends AbstractIndexComponent implements XCont
|
||||||
if (token == XContentParser.Token.FIELD_NAME) {
|
if (token == XContentParser.Token.FIELD_NAME) {
|
||||||
currentFieldName = parser.currentName();
|
currentFieldName = parser.currentName();
|
||||||
} else {
|
} else {
|
||||||
if ("value".equals(currentFieldName)) {
|
if ("term".equals(currentFieldName)) {
|
||||||
|
value = parser.text();
|
||||||
|
} else if ("value".equals(currentFieldName)) {
|
||||||
value = parser.text();
|
value = parser.text();
|
||||||
} else if ("boost".equals(currentFieldName)) {
|
} else if ("boost".equals(currentFieldName)) {
|
||||||
boost = parser.floatValue();
|
boost = parser.floatValue();
|
||||||
|
|
|
@ -66,7 +66,9 @@ public class TermQueryParser extends AbstractIndexComponent implements XContentQ
|
||||||
if (token == XContentParser.Token.FIELD_NAME) {
|
if (token == XContentParser.Token.FIELD_NAME) {
|
||||||
currentFieldName = parser.currentName();
|
currentFieldName = parser.currentName();
|
||||||
} else {
|
} else {
|
||||||
if ("value".equals(currentFieldName)) {
|
if ("term".equals(currentFieldName)) {
|
||||||
|
value = parser.text();
|
||||||
|
} else if ("value".equals(currentFieldName)) {
|
||||||
value = parser.text();
|
value = parser.text();
|
||||||
} else if ("boost".equals(currentFieldName)) {
|
} else if ("boost".equals(currentFieldName)) {
|
||||||
boost = parser.floatValue();
|
boost = parser.floatValue();
|
||||||
|
|
|
@ -70,6 +70,8 @@ public class WildcardQueryParser extends AbstractIndexComponent implements XCont
|
||||||
} else {
|
} else {
|
||||||
if ("wildcard".equals(currentFieldName)) {
|
if ("wildcard".equals(currentFieldName)) {
|
||||||
value = parser.text();
|
value = parser.text();
|
||||||
|
} else if ("value".equals(currentFieldName)) {
|
||||||
|
value = parser.text();
|
||||||
} else if ("boost".equals(currentFieldName)) {
|
} else if ("boost".equals(currentFieldName)) {
|
||||||
boost = parser.floatValue();
|
boost = parser.floatValue();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue