query = Q("nested",
path="text",
score_mode="max",
ignore_unmapped=True,
query=Q("match", **{"text.lyric": value}))
Now I want to construct a query, How can I add parameter fuzziness to the above code?
thanks ahead
query = Q("nested", path="text", score_mode="max", ignore_unmapped=True, query=Q("match", text__lyric={"query": value, "fuzziness": 1}))
should do the trick. Essentially always take the json from the documentation (0) and translate the top level keys to keyword arguments. In this case you can also use __ instead of . to avoida having to do the **{} construct.
Hope this helps!
0 - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#query-dsl-match-query-fuzziness
Most helpful comment
should do the trick. Essentially always take the
jsonfrom the documentation (0) and translate the top level keys to keyword arguments. In this case you can also use__instead of.to avoida having to do the**{}construct.Hope this helps!
0 - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#query-dsl-match-query-fuzziness