0
votes

In Elasticsearch I am capable of finding the results of a query (in this case "Science") with following code:

from elasticsearch import Elasticsearch
es=Elasticsearch([{'host':'localhost','port':9200}])

from elasticsearch_dsl import Search    

s = Search(using=es, index="my_name").query("match", text="Science")

But let's say I type "Sci3nce" then I get not results back.

How can I do fuzzy querying without using request, but using the elasticsearch library of python3?

1

1 Answers

1
votes

Try the fuzzy query:

s = Search(using=es, index="my_name").query("fuzzy", text={"query": "Sci3nce", "fuzziness": 2})