Cannot find though the whole document

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?

Thanks!

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

  1. adjust index-time boost with a mapping
    (Elasticsearch Platform — Find real-time answers at scale | Elastic)
    and/or
  2. adjust query-time boost with a multi-field query_string
    (Elasticsearch Platform — Find real-time answers at scale | Elastic)

On Thu, Oct 13, 2011 at 10:09 AM, Андрей andrey.smolev@gmail.com wrote:

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?

Thanks!

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

  1. adjust index-time boost with a mapping
    (Elasticsearch Platform — Find real-time answers at scale | Elastic)
    and/or
  2. adjust query-time boost with a multi-field query_string
    (
    Elasticsearch Platform — Find real-time answers at scale | Elastic
    )

On Thu, Oct 13, 2011 at 10:09 AM, Андрей andrey.smolev@gmail.com wrote:

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?

Thanks!

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.

On Fri, Oct 14, 2011 at 10:59 AM, Андрей Смолев andrey.smolev@gmail.com wrote:

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

  1. adjust index-time boost with a mapping
    (Elasticsearch Platform — Find real-time answers at scale | Elastic)
    and/or
  2. adjust query-time boost with a multi-field query_string

(Elasticsearch Platform — Find real-time answers at scale | Elastic)

On Thu, Oct 13, 2011 at 10:09 AM, Андрей andrey.smolev@gmail.com wrote:

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?

Thanks!

Thank you, it works for me!
On Oct 15, 2011 1:44 AM, "Gabriel Farrell" gsf747@gmail.com wrote: