klm_
klm_

Reputation: 1209

QueryString query with wildcard omitting result

I have following configuration:

Mapping:

  "payload": {
    "type": "string",
    "analyzer": "whitespace_analyzer"
  },

Analyzer:

"analysis": {
          "analyzer": {
            "whitespace_analyzer": {
              "filter": [
                "lowercase"
              ],
              "type": "custom",
              "tokenizer": "whitespace"
            }
          }
        },

and sample data (each is a separate document):

Data 1:

[ABCD-1234567890]

Data 2 (i have issues with this one):

<ns0:ConversationId>ABCD-1234567890</ns0:ConversationId>

Data 3:

ConversationNumber="ABCD-1234567890"

Query:

"query": {
"bool": {
  "must": [
    {
      "query_string": {
        "default_field": "payload",
        "query": "*ABCD-1234567890*",
        "analyze_wildcard": true
      }
    }
  ]    } }

Data 2 is not returned with the query above. Why is that? If I change query to: "query": "*234567890*" it is returned.

Upvotes: 0

Views: 54

Answers (1)

klm_
klm_

Reputation: 1209

Thanks to help of Andrei Stefan I was able to track the issue.

Finally the problem was that Data 2 was to long and tokenizer split it into 2 tokens. One token ended with "ABCD-1" and another one started with "234567890"

Upvotes: 1

Related Questions