Multi_match fuzzy in filter


(Mark Varley) #1

I am trying to execute an elasticsearch query (I am using 2.4.6) with a bool filter that includes a multimatch query over best_fields with fuzziness set to 1 however the query only yields a match with exact spelling. As far as I can see in the docs there is nothing to suggest that fuzziness is not allowed in filters. Any advice would be much appreciated, I have been working at this for hours and trawling forums but I cannot see what I am doing wrong. A subset of my query is below. Many thanks.

{
  "query": {
    "bool": {
      "must": [
        ...
      ],
      "should": [
        ...
      ],
      "filter": [
        {
          "bool": {
            "must": [
              {
                "bool": {
                  "should": [
                    {
                      "multi_match": {
                        "query": "HIGH STREEET",
                        "fields": [
                          "organisation*",
                          "building_name*",
                          "building_group*",
                          "*street*",
                          "*locality*"
                        ],
                        "type": "best_fields",
                        "operator": "and",
                        "fuzziness": 1,
                        "prefix_length": 3
                      }
                    },
                    {
                      ...
                    }
                  ]
                }
              },
              {
              ....
              }
            ]
          }
        }
      ]
    }
  }
}

(Mark Varley) #2

Please ignore this, the issue is not with the fuzzy query in a filter but a custom analyzer, please disregard


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.