Fuzzy query returns nothing when value length is greather than one


(rodrigoal) #1

I've the following query:
"query" : { "bool" : { "should" : [ { "fuzzy" : { "title" : { "min_similarity" : 0.6, "boost" : 2, "value" : term } } }, { "fuzzy" : { "entities.text" : { "min_similarity" : 0.6, "boost" : 3, "value" : term } } } ], "minimum_number_should_match": 1, } }
If term is "Thompsn" I get the following results:
results: 2 [{'entities': [u'Bill Thompson'], 'summary': u'Bill Thompson is con', 'title': u'Bill Thompson Concedes Democratic Nomination In NYC Mayor Race To Bill De Blasio: Report'}, {'entities': [], 'summary': u'AP\nThe Ravens took a', 'title': u'Ravens Pierce, Thompson getting checkedout'}]
But if term is "Bill thompsn" I get 0 results. I don't know what I'm doing wrong, I've been reading the ES documentation but didn't find a way to solve this.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(simonw-2) #2

match_query
(http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html)
with "fuzziness" : 0.6 should do what you are looking for

simon

On Monday, October 21, 2013 5:50:57 PM UTC+2, Mariano Alvarez wrote:

I've the following query:

        "query" : {
              "bool" : {
                 "should" : [
                    {
                       "fuzzy" : {
                          "title" : {
                             "min_similarity" : 0.6,
                             "boost" : 2,
                             "value" : term
                          }
                       }
                    },
                    {
                       "fuzzy" : {
                          "entities.text" : {
                             "min_similarity" : 0.6,
                             "boost" : 3,
                             "value" : term
                          }
                       }
                    }                        
                 ],
                 "minimum_number_should_match": 1,
              }
       }

If term is "Thompsn" I get the following results:

results: 2
[{'entities': [u'Bill Thompson'],
  'summary': u'Bill Thompson is con',
  'title': u'Bill Thompson Concedes Democratic Nomination In NYC Mayor 

Race To Bill De Blasio: Report'},
{'entities': [],
'summary': u'AP\nThe Ravens took a',
'title': u'Ravens Pierce, Thompson getting checkedout'}]

But if term is "Bill thompsn" I get 0 results. I don't know what I'm doing
wrong, I've been reading the ES documentation but didn't find a way to
solve this.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3