0

this is my elastic search query, I want to search in all languages under data.title and not particularly eng.

if i put data.title there are 0 results.

{
  "bool": {
    "must": [
      {
        "span_near": {
          "clauses": {
            "0": {
              "span_multi": {
                "match": {
                  "wildcard": {
                    "data.Title.eng": "method"
                  }
                }
              }
            },
            "1": {
              "span_multi": {
                "match": {
                  "wildcard": {
                    "data.Title.eng": "system"
                  }
                }
              }
            }
          },
          "slop": 1,
          "in_order": false
        }
      }
    ]
  }
}
sawan mehta
  • 51
  • 1
  • 7

1 Answers1

0

Instead of wildcard query , try to use query_string :-

Example :-

   {
        "query": {
            "query_string": {
                "default_field": "data.Title.*",
                "query": "*zz* *ell*"
            }
        }
    }

query_string is more effective than wildcard in search . To get more difference between them , check this link

Community
  • 1
  • 1
Vijay
  • 4,694
  • 1
  • 30
  • 38