What I want is that the names of the cities can be misspelled, and the user
still gets some (hopefully correct) results.
On the other hand, if the user searches via zip-code, the fuzziness should
not be applied to the zip-code, but only to the name of the city.
In my example data above, if i'd search for
curl -X POST 'localhost:9200/geodb/_suggest?pretty' -d '{
"city-suggest" : {
"text" : "12345 Ci",
"completion" : {
"field" : "suggest",
"fuzzy" : {
"edit_distance" : 2
}
}
}
}'
I'd get 2 results, but since I entered a valid zip-code, I'd only like to
get the one result with that exact zip-code. But still maintain fuzziness
on the name of the city.
I do understand that ElasticSearch's behavior totally makes sense, since
I've requested the data with a fuzzy span.
But is there a way to reach my goal?
What I want is that the names of the cities can be misspelled, and the
user still gets some (hopefully correct) results.
On the other hand, if the user searches via zip-code, the fuzziness should
not be applied to the zip-code, but only to the name of the city.
In my example data above, if i'd search for
curl -X POST 'localhost:9200/geodb/_suggest?pretty' -d '{
"city-suggest" : {
"text" : "12345 Ci",
"completion" : {
"field" : "suggest",
"fuzzy" : {
"edit_distance" : 2
}
}
}
}'
I'd get 2 results, but since I entered a valid zip-code, I'd only like to
get the one result with that exact zip-code. But still maintain fuzziness
on the name of the city.
I do understand that Elasticsearch's behavior totally makes sense, since
I've requested the data with a fuzzy span.
But is there a way to reach my goal?
Any chance to increase the number of returned results?
At the moment, I only get a maximum of 5 suggestions, although there are
more locations in the index that should match the query.
Thanks
Thorsten
Am Freitag, 18. Oktober 2013 21:09:37 UTC+2 schrieb simonw:
try using the "prefix_length" parameter and set it to the length of you
zipcode then the fuzziness will not be applied to that prefix
simon
On Friday, October 18, 2013 12:44:18 PM UTC+2, Thorsten wrote:
Dear ElasticSearchers,
I'm trying to get the new completion suggester to help me suggesting my
users locations (cities).
What I want is that the names of the cities can be misspelled, and the
user still gets some (hopefully correct) results.
On the other hand, if the user searches via zip-code, the fuzziness
should not be applied to the zip-code, but only to the name of the city.
In my example data above, if i'd search for
curl -X POST 'localhost:9200/geodb/_suggest?pretty' -d '{
"city-suggest" : {
"text" : "12345 Ci",
"completion" : {
"field" : "suggest",
"fuzzy" : {
"edit_distance" : 2
}
}
}
}'
I'd get 2 results, but since I entered a valid zip-code, I'd only like to
get the one result with that exact zip-code. But still maintain fuzziness
on the name of the city.
I do understand that Elasticsearch's behavior totally makes sense, since
I've requested the data with a fuzzy span.
But is there a way to reach my goal?
On Saturday, October 19, 2013 11:11:58 AM UTC+2, Thorsten wrote:
Thank you, that does the trick!
Any chance to increase the number of returned results?
At the moment, I only get a maximum of 5 suggestions, although there are
more locations in the index that should match the query.
Thanks
Thorsten
Am Freitag, 18. Oktober 2013 21:09:37 UTC+2 schrieb simonw:
try using the "prefix_length" parameter and set it to the length of you
zipcode then the fuzziness will not be applied to that prefix
simon
On Friday, October 18, 2013 12:44:18 PM UTC+2, Thorsten wrote:
Dear ElasticSearchers,
I'm trying to get the new completion suggester to help me suggesting my
users locations (cities).
What I want is that the names of the cities can be misspelled, and the
user still gets some (hopefully correct) results.
On the other hand, if the user searches via zip-code, the fuzziness
should not be applied to the zip-code, but only to the name of the city.
In my example data above, if i'd search for
curl -X POST 'localhost:9200/geodb/_suggest?pretty' -d '{
"city-suggest" : {
"text" : "12345 Ci",
"completion" : {
"field" : "suggest",
"fuzzy" : {
"edit_distance" : 2
}
}
}
}'
I'd get 2 results, but since I entered a valid zip-code, I'd only like
to get the one result with that exact zip-code. But still maintain
fuzziness on the name of the city.
I do understand that Elasticsearch's behavior totally makes sense, since
I've requested the data with a fuzzy span.
But is there a way to reach my goal?
Am Samstag, 19. Oktober 2013 20:17:57 UTC+2 schrieb simonw:
"size" : X should work just fine no?
simon
On Saturday, October 19, 2013 11:11:58 AM UTC+2, Thorsten wrote:
Thank you, that does the trick!
Any chance to increase the number of returned results?
At the moment, I only get a maximum of 5 suggestions, although there are
more locations in the index that should match the query.
Thanks
Thorsten
Am Freitag, 18. Oktober 2013 21:09:37 UTC+2 schrieb simonw:
try using the "prefix_length" parameter and set it to the length of you
zipcode then the fuzziness will not be applied to that prefix
simon
On Friday, October 18, 2013 12:44:18 PM UTC+2, Thorsten wrote:
Dear ElasticSearchers,
I'm trying to get the new completion suggester to help me suggesting my
users locations (cities).
What I want is that the names of the cities can be misspelled, and the
user still gets some (hopefully correct) results.
On the other hand, if the user searches via zip-code, the fuzziness
should not be applied to the zip-code, but only to the name of the city.
In my example data above, if i'd search for
curl -X POST 'localhost:9200/geodb/_suggest?pretty' -d '{
"city-suggest" : {
"text" : "12345 Ci",
"completion" : {
"field" : "suggest",
"fuzzy" : {
"edit_distance" : 2
}
}
}
}'
I'd get 2 results, but since I entered a valid zip-code, I'd only like
to get the one result with that exact zip-code. But still maintain
fuzziness on the name of the city.
I do understand that Elasticsearch's behavior totally makes sense,
since I've requested the data with a fuzzy span.
But is there a way to reach my goal?
good stuff!! We are also working on adding support for a geo location in
the suggester that allows you to "pre-filter" based on where the users "is"
or it's "view" / "BoundingBox" center is.
happy that is worked out
simon
On Saturday, October 19, 2013 9:01:38 PM UTC+2, Thorsten wrote:
Thank you for being patient with me, I did give that a try before, but got
an exception.
Just had the parameter placed on the wrong spot...
Am Samstag, 19. Oktober 2013 20:17:57 UTC+2 schrieb simonw:
"size" : X should work just fine no?
simon
On Saturday, October 19, 2013 11:11:58 AM UTC+2, Thorsten wrote:
Thank you, that does the trick!
Any chance to increase the number of returned results?
At the moment, I only get a maximum of 5 suggestions, although there are
more locations in the index that should match the query.
Thanks
Thorsten
Am Freitag, 18. Oktober 2013 21:09:37 UTC+2 schrieb simonw:
try using the "prefix_length" parameter and set it to the length of you
zipcode then the fuzziness will not be applied to that prefix
simon
On Friday, October 18, 2013 12:44:18 PM UTC+2, Thorsten wrote:
Dear ElasticSearchers,
I'm trying to get the new completion suggester to help me suggesting
my users locations (cities).
What I want is that the names of the cities can be misspelled, and the
user still gets some (hopefully correct) results.
On the other hand, if the user searches via zip-code, the fuzziness
should not be applied to the zip-code, but only to the name of the city.
In my example data above, if i'd search for
curl -X POST 'localhost:9200/geodb/_suggest?pretty' -d '{
"city-suggest" : {
"text" : "12345 Ci",
"completion" : {
"field" : "suggest",
"fuzzy" : {
"edit_distance" : 2
}
}
}
}'
I'd get 2 results, but since I entered a valid zip-code, I'd only like
to get the one result with that exact zip-code. But still maintain
fuzziness on the name of the city.
I do understand that Elasticsearch's behavior totally makes sense,
since I've requested the data with a fuzzy span.
But is there a way to reach my goal?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.