Hi,
I have following mapping:
curl -XPUT 'http://localhost:9200/acqindex/' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 1,
"analysis" : {
"analyzer" : {
"str_search_analyzer" : {
"tokenizer" : "standard",
"filter" :
["lowercase","asciifolding","suggestions_shingle","edgengram"]
},
"str_index_analyzer" : {
"tokenizer" : "standard",
"filter" :
["lowercase","asciifolding","suggestions_shingle","edgengram"]
}
},
"filter" : {
"suggestions_shingle": {
"type": "shingle",
"min_shingle_size": 2,
"max_shingle_size": 5
},
"edgengram" : {
"type" : "edgeNGram",
"min_gram" : 2,
"max_gram" : 30,
"side" : "front"
}
}
}
}
}
}'
Also, Following data is indexed in ElasticSearch:-
curl -XPUT 'localhost:9200/acqindex/acqidx/1' -d '{ text:"Hotels in Hoscur"
}',
curl -XPUT 'localhost:9200/acqindex/acqidx/2' -d '{ text:"Hotels in
innsburg" }'
curl -XPUT 'localhost:9200/acqindex/acqidx/3' -d '{ text:"Hotels in ink" }'
curl -XPUT 'localhost:9200/acqindex/acqidx/4' -d '{ text:"Hotels in
houston" }'
curl -XPUT 'localhost:9200/acqindex/acqidx/4' -d '{ text:"Hotels in
darjeling" }'
curl -XPUT 'localhost:9200/acqindex/acqidx/5' -d '{ text:"Hotels in darjel"
}'
curl -XPUT 'localhost:9200/acqindex/acqidx/6' -d '{ text:"Hotels in india"
}'
Now, if I query like this:
curl -XGET localhost:9200/acqindex/_search -d '{
"query": {
"query_string" : {
"query": "hotel"
}
}
}'
It is not able to find any document. But my index analyzer generates
"hotel" as one of the token. So, why ElasticSearch is not able to find
above listed documents.
Also, I have other doubts regarding ElasticSearch Query mechanism:
-
Whenever I query for "hotels" ElasticSearch gives me all the above
listed docs but the order is somewhat biased towards more such docs which
contains greater occurrences of "ho" or "in". Is it like ElasticSearch
gives more weightage to docs where the no. of tokens of a particular type
like "ho" is more ? -
Also, sometimes when I search in ElasticSearch, it don't give me those
docs on the top which have exact same text phrase. In fact, it keeps
showing other docs which contains some extraneous text words. How can I
tackle this problem. I can't search for exact user typed text phrase since
there are many ways to query a single thing. I want to search all the docs
that can be possible matches but somehow I want my results to be biased
towards docs which contains exact phrases on the top and rest of the
matches to be in the bottom. for eg, if I search for hotel oberoi in delhi
then I want results like:
hotel oberoi in delhi
hotel oberoi
hotel in delhi
hotels in delhi
-
Is there any query type which are generally used for autocompleters
which are based on ElasticSearch. Or, if anyone has a better idea of
querying in ElasticSearch. -
Is there anything like a machine learning in query mechanism so that I
can understand what user wants while typing so that I can give better
results.
I really like ElasticSearch but it's giving me a hell lot of problem
implementing Autocompleter.
How can I modify my index and search analyzers for better results.
PS : I'm using ElasticSearch-0.90.3 and right now I can't move to latest
version.
Please help with the above stuff guys.
Thanks
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4c86a60e-fef6-4215-a3cd-64f0845fb8e1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.