Fuzzy query exclude exact match

Is there any way to express the 'fuzziness' parameter in terms of a range that excludes exact matches or fuzziness = 0 hits? Basically just a return on fuzzy matches of edit distances 1 and 2?

Use a bool query where a fuzzy match is a must but an exact match is a must_not ?

GET news/_search
{
  "query": {
	"bool": {
	  "must": [
		{
		  "match": {
			"headline": {
			  "query": "accommodation",
			  "fuzziness": 2
			}
		  }
		}
	  ],
	  "must_not": [
		{
		  "match": {
			"headline": {
			  "query": "accommodation"
			}
		  }
		}
	  ]
	}
  }
}

Just what I needed - thank you Mark!

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