Hey,
try running the analyze API for numbers using the simple analyzer and
compare it with the output of the standard analyzer
» curl 'localhost:9200/_analyze?analyzer=standard' -d '12345'
{"tokens":[{"token":"12345","start_offset":0,"end_offset":5,"type":"","position":1}]}
» curl 'localhost:9200/_analyze?analyzer=simple' -d '12345'
{"tokens":}
as you can see, the simple analyzer actually removed the numbers.
So most likely the simple analyzer is not useful to return numbers in your
case and you should stick with another analyzer, as the simple analyzer
removes any numbers - which explains you not getting any results.
--Alex
On Thu, Nov 21, 2013 at 8:07 PM, Mahesh Kommareddi <
mahesh.kommareddi@gmail.com> wrote:
Hi,
I'm using and testing against 0.90.5 (three nodes and five shards) and
0.90.7 (one node and five shards). I'm interested in the completion
suggester and it works great for items where letters are involved. For
example, first names, last names, states, cities, or product names all
return suggestions. This is with the help of the documentation that is on
the Elasticsearch website:Elasticsearch Platform — Find real-time answers at scale | Elastic
As an example, I created a 'numbers' index with a type named 'zipcode'.
The stored document contains a field that is a string:
Creation of a mapping for zipcodes · GitHubI receive: {"ok":true,"acknowledged":true}
Next, I insert some zipcodes as strings:
Adding document to the type · GitHubI receive:
{"ok":true,"_index":"numbers","_type":"zipcode","_id":"1","_version":1}
{"ok":true,"_index":"numbers","_type":"zipcode","_id":"2","_version":1}Now the suggestion:
Asking for a suggestion based on one of the inputted documents. · GitHubI expect the "90210" string to be returned. However, I get no result:
{
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"numbers-suggest" : [ {
"text" : "902",
"offset" : 0,
"length" : 3,
"options" :
} ]
}Just to be sure, I insert an item that contains alphabetical items only
and query for a suggestion:
Adding a non-numeric item and asking for a suggestion · GitHubWhich returns a result as expected:
{
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"numbers-suggest" : [ {
"text" : "bl",
"offset" : 0,
"length" : 2,
"options" : [ {
"text" : "Blah blah",
"score" : 1.0, "payload" : {"area code":0}
} ]
} ]
}It appears that zipcodes ("90210", "29268", "28262"), phone numbers ("
7042315555", "5555555555", 9999999999"), and addresses starting with
numbers ("123 Rose Ln", "111 White St", etc) are not suggested even though
all these items are stored as strings. Is this a limitation? If so, is
there a way around it?Thanks,
Mahesh--
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.
--
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.