Sorry if this is RTFM, but i spent several hours tried to compose
search query.
I have a clothes index with shirts, shoes and so on. All items have
some attributes such as collor, size, brand. In my application i have
search string like "red nike t-shirt" or just "red shirt". How can i
make elasticsearch to find relevant items?
You'll have to be more specific. Can you show us an example document?
Are you using explicit mappings? Are you using query_string in the
query DSL? In general, if you're adjusting relevancy, you'll want to
Sorry if this is RTFM, but i spent several hours tried to compose
search query.
I have a clothes index with shirts, shoes and so on. All items have
some attributes such as collor, size, brand. In my application i have
search string like "red nike t-shirt" or just "red shirt". How can i
make elasticsearch to find relevant items?
Resolved it this way
source={"query":{"query_string":{"default_field":"_all",
"default_operator":"AND","query":"white~0.7 shoes~0.7
adidas~0.7"}},"fields":["colorList","price","picture","name","vendor","shop","sizeList","colour_image","elegance","offer
id","description"],"size":100,"sort":{"_score":{"order":"desc"}},"filter":{"and":[{"term":{"available":1}}]}}
But I do not like "~0.7" in the querry, now I parse input string and replace
spaces with "~0.7 " but may be there is any better solution? tried "
fuzzy_min_sim":0.7 but it doesn't work like ~0.7...
On Fri, Oct 14, 2011 at 12:45 AM, Gabriel Farrell gsf747@gmail.com wrote:
You'll have to be more specific. Can you show us an example document?
Are you using explicit mappings? Are you using query_string in the
query DSL? In general, if you're adjusting relevancy, you'll want to
Sorry if this is RTFM, but i spent several hours tried to compose
search query.
I have a clothes index with shirts, shoes and so on. All items have
some attributes such as collor, size, brand. In my application i have
search string like "red nike t-shirt" or just "red shirt". How can i
make elasticsearch to find relevant items?
fuzzy_min_sim only applies to terms with a tilde, but no required
similarity set. So you could change your query to "white~ shoes~
adidas~" and set fuzzy_min_sim to 0.7 for the same result.
Since you're already parsing the input, however, you might consider
putting all the terms in a fuzzy query (boosted at 0.8 or so) and
running it alongside the regular query.
Resolved it this way
source={"query":{"query_string":{"default_field":"_all",
"default_operator":"AND","query":"white~0.7 shoes~0.7
adidas~0.7"}},"fields":["colorList","price","picture","name","vendor","shop","sizeList","colour_image","elegance","offer
id","description"],"size":100,"sort":{"_score":{"order":"desc"}},"filter":{"and":[{"term":{"available":1}}]}}
But I do not like "~0.7" in the querry, now I parse input string and replace
spaces with "~0.7 " but may be there is any better solution? tried
"fuzzy_min_sim":0.7 but it doesn't work like ~0.7...
On Fri, Oct 14, 2011 at 12:45 AM, Gabriel Farrell gsf747@gmail.com wrote:
You'll have to be more specific. Can you show us an example document?
Are you using explicit mappings? Are you using query_string in the
query DSL? In general, if you're adjusting relevancy, you'll want to
Sorry if this is RTFM, but i spent several hours tried to compose
search query.
I have a clothes index with shirts, shoes and so on. All items have
some attributes such as collor, size, brand. In my application i have
search string like "red nike t-shirt" or just "red shirt". How can i
make elasticsearch to find relevant items?
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.