PayloadCheckerSpanFilter

De JDONREF Wiki
Révision de 6 octobre 2014 à 19:05 par Julien2512 (discussion | contributions) (Page créée avec « Check results for grammar rules according to payloads values. For example, the document : { "fullName": "BOULEVARD|1 DE|1 PARIS|1 07|2 L|3 HOPITAL|3" } with the follo... »)

(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

Check results for grammar rules according to payloads values.

For example, the document :

 { "fullName": "BOULEVARD|1 DE|1 PARIS|1 07|2 L|3 HOPITAL|3" }

with the following mapping :

 "fullName" : {"type": "string", "term_vector" : "with_positions_offsets_payloads", "index_analyzer":"myAnalyzer"}

and settings like :

 {
   "index" : {
      "analysis" : {
          "analyzer": {
              "myAnalyzer" : {
                  "type" : "custom",
                  "tokenizer" : "whitespace",
                  "filter" : ["delimited_payload_filter", "lowercase", "tokencount_payload_filter"]
              }
          },
          "filter" : {
              "delimited_payload_filter" : {
                "type": "delimited_payload_filter",
                "delimiter" : "|",
                "encoding" : "int"
              },
              "tokencount_payload_filter" : {
                "type": "tokencountpayloads",
                "factor": 1000
              }
      }
 } 

will match the query :

 {
   "span_payloadchecker" : {
       "clauses": [
         { "span_multipayloadterm" : { "fullName": "BOULEVARD" } },
         { "span_multipayloadterm" : { "fullName": "PARIS" } },
         { "span_multipayloadterm" : { "fullName": "HOPITAL" } }
       ],
       "checker": { "type":"Grouped" }
   }
 }

but not match the following :

 {
   "span_payloadchecker" : {
       "clauses": [
         { "span_multipayloadterm" : { "fullName": "BOULEVARD" } },
         { "span_multipayloadterm" : { "fullName": "HOPITAL" } }
         { "span_multipayloadterm" : { "fullName": "PARIS" } },
       ],
       "checker": { "type":"Grouped" }
   }
 }

because BOULEVARD and PARIS are not grouped together in the second request.


Notice the following checkers :

checker type description sample
And All the given checkers from data array must validate to validate the document { "type":"And", "data" : [ ... ] }
Or One of the given checkers from data array must validate to validate the document { "type":"Or", "data" : [ ... ] }
Xor Only one of the given checkers from data array must validate to validate the document { "type":"Xor", "data" : [ ... ] }
Not The given checker 'data' must not validate to validate the document { "type":"Not", "data" : [ ... ] }
All All the tokens with the given payload (bytes[] or int) must match to validate the document { "type":"All", "payload" : "AAAD8Q==" }
One One token with the given payload (bytes[] or int) must match to validate the document { "type":"One", "payload" : "AAAD8Q==" }
Field Field value must match to validate the document { "type":"Field", "field" : "type_de_voie", "value" : "BOULEVARD" }
Grouped Groups of tokens by payloads must not interlace to validate the document { "type":"Grouped" }
Grouped Groups of tokens by payloads must not interlace to validate the document { "type":"Grouped" }