You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: solr/solr-ref-guide/src/other-parsers.adoc
+28-17Lines changed: 28 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -977,16 +977,11 @@ For more information about the possibilities of nested queries, see Yonik Seeley
977
977
978
978
== Payload Query Parsers
979
979
980
-
These query parsers utilize payloads encoded on terms during indexing.
981
-
982
-
The main query, for both of these parsers, is parsed straightforwardly from the field type's query analysis into a `SpanQuery`. The generated `SpanQuery` will be either a `SpanTermQuery` or an ordered, zero slop `SpanNearQuery`, depending on how many tokens are emitted. Payloads can be encoded on terms using either the `DelimitedPayloadTokenFilter` or the `NumericPayloadTokenFilter`. The payload using parsers are:
983
-
984
-
* `PayloadScoreQParser`
985
-
* `PayloadCheckQParser`
980
+
These query parsers utilize payloads encoded on terms during indexing. Payloads can be encoded on terms using either the `DelimitedPayloadTokenFilter` or the `NumericPayloadTokenFilter`.
986
981
987
982
=== Payload Score Parser
988
983
989
-
`PayloadScoreQParser` incorporates each matching term's numeric (integer or float) payloads into the scores.
984
+
`PayloadScoreQParser` incorporates each matching term's numeric (integer or float) payloads into the scores. The main query is parsed from the field type's query analysis into a `SpanQuery` based on the value of the `operator` parameter below.
990
985
991
986
This parser accepts the following parameters:
992
987
@@ -997,7 +992,9 @@ The field to use. This parameter is required.
997
992
The payload function. The options are: `min`, `max`, `average`, or `sum`. This parameter is required.
998
993
999
994
`operator`::
1000
-
A search operator. The options are `or` and `phrase`, which is the default. This defines if the search query should be an OR query or a phrase query.
995
+
A search operator. The options are
996
+
* `or` will generate either a `SpanTermQuery` or a `SpanOrQuery` depending on the number of tokens emitted.
997
+
* `phrase` will generate either `SpanTermQuery` or an ordered, zero slop `SpanNearQuery`, depending on how many tokens are emitted.
1001
998
1002
999
`includeSpanScore`::
1003
1000
If `true`, multiples the computed payload factor by the score of the original query. If `false`, the default, the computed payload factor is the score.
@@ -1012,26 +1009,40 @@ If `true`, multiples the computed payload factor by the score of the original qu
1012
1009
1013
1010
=== Payload Check Parser
1014
1011
1015
-
`PayloadCheckQParser` only matches when the matching terms also have the specified payloads.
1012
+
`PayloadCheckQParser` only matches when the matching terms also have the specified relationship to the payloads. The default relationship is equals, however, inequality matching can also be performed. The main query, for both of these parsers, is parsed straightforwardly from the field type's query analysis into a `SpanQuery`. The generated `SpanQuery` will be either a `SpanTermQuery` or an ordered, zero slop `SpanNearQuery`, depending on how many tokens are emitted. The net effect is that the main query always operates in a manner similar to a phrase query in the standard lucene parser (thus ignoring any value for `q.op`).
1013
+
1014
+
NOTE: If when the field analysis is applied to the query, it alters the number of tokens, the final number of tokens must match the number of payloads supplied in the `payloads` parameter. If there is a mismatch between the number of query tokens, and the number of payload values supplied with this query, the query will not match.
1016
1015
1017
1016
This parser accepts the following parameters:
1018
1017
1019
1018
`f`::
1020
1019
The field to use (required).
1021
1020
1022
1021
`payloads`::
1023
-
A space-separated list of payloads that must match the query terms (required)
1024
-
+
1025
-
Each specified payload will be encoded using the encoder determined from the field type and encoded accordingly for matching.
1026
-
+
1027
-
`DelimitedPayloadTokenFilter` 'identity' encoded payloads also work here, as well as float and integer encoded ones.
1022
+
A space-separated list of payloads to be compared with payloads in the matching tokens from the document (required). Each specified payload will be encoded using the encoder determined from the field type prior to matching. Integer, float and identity (string) encodings are supported with the same meanings as for DelimitedPayloadTokenFilter.
1023
+
1024
+
`op`::
1025
+
The inequality operation to apply to the payload check. All operations require that consecutive tokens derived from the analysis of the query match consecutive tokens in the document, and additionally the payloads on the document tokens must be:
1026
+
* `eq` - equal to the specified payloads (default)
1027
+
* `gt` - greater than the specified payloads
1028
+
* `lt` - less than the specified payloads
1029
+
* `gte` - greater than or equal to the specified payloads
1030
+
* `lte` - less than or equal to the specified payloads
1028
1031
1029
-
*Example*
1032
+
*Examples*
1030
1033
1034
+
Find all documents with the phrase "searching stuff" where searching has a payload of "VERB" and "stuff" has a payload of "NOUN"
0 commit comments