I was wondering whether it's possible to boost a field based on its value.
Let me explain my scenario.
At my website, we're indexing products from different shops, but the book
shops are the ones with most products, so when I search for "iphone", let's
say, I get most of the first results with books interwingled.
Would it be possible to negatively boost based on whether the record is a
book (I have a field which specifies the category, so I could identify it
with no issues)?
The idea would be to boost results that are not books, but without losing
the books, of course. Just would like to push them further in terms of
relevance.
Not sure if I fully understand your use base, but you want to change the
boost depending on the query? For example, changing the category boost if
the query is for iPhone? You can look at the query before you send the
request to ES and change the boost accordingly. I believe every query type
has a boost attribute.
There is something called a Boost Query, which I have never tried, but is
not might not be what you are looking for since you need to affect the boost
on a field that is not search on:
If you simply want to lower the boost for any results from the book store,
why not set the boost for the category type in the mapping?
Ivan
On Fri, Apr 8, 2011 at 11:02 AM, Enrique Medina Montenegro < e.medina.m@gmail.com> wrote:
Hi,
I was wondering whether it's possible to boost a field based on its value.
Let me explain my scenario.
At my website, we're indexing products from different shops, but the book
shops are the ones with most products, so when I search for "iphone", let's
say, I get most of the first results with books interwingled.
Would it be possible to negatively boost based on whether the record is a
book (I have a field which specifies the category, so I could identify it
with no issues)?
The idea would be to boost results that are not books, but without losing
the books, of course. Just would like to push them further in terms of
relevance.
Issue is I can have other categories, so just boosting the field category
would have side effects.
Basically I would like to be able to do something like this:
"Get me all the products which match "iphone", but leave the results coming
from a product whose "category1=books" at the end, so the ones coming from
other categories, like "electronics or computers" are "more relevant"...
On Fri, Apr 8, 2011 at 5:54 PM, Ivan Brusic ivan@brusic.com wrote:
Hi Enrique,
Not sure if I fully understand your use base, but you want to change the
boost depending on the query? For example, changing the category boost if
the query is for iPhone? You can look at the query before you send the
request to ES and change the boost accordingly. I believe every query type
has a boost attribute.
There is something called a Boost Query, which I have never tried, but is
not might not be what you are looking for since you need to affect the boost
on a field that is not search on:
On Fri, Apr 8, 2011 at 11:02 AM, Enrique Medina Montenegro < e.medina.m@gmail.com> wrote:
Hi,
I was wondering whether it's possible to boost a field based on its value.
Let me explain my scenario.
At my website, we're indexing products from different shops, but the book
shops are the ones with most products, so when I search for "iphone", let's
say, I get most of the first results with books interwingled.
Would it be possible to negatively boost based on whether the record is a
book (I have a field which specifies the category, so I could identify it
with no issues)?
The idea would be to boost results that are not books, but without losing
the books, of course. Just would like to push them further in terms of
relevance.
I'm currently using "query_string" for my queries, but boost here is applied
to the whole query, not just a specific field. How could I specify the boost
for a field in this type of query?
I'm currently using "query_string" for my queries, but boost here is
applied to the whole query, not just a specific field. How could I
specify the boost for a field in this type of query?
In the meantime, I was searching the custom_score_query, but I just cannot
make the query work (I send it but I never get a response back, and there's
nothing in the logs). Do you know what could be wrong with this query?
I'm currently using "query_string" for my queries, but boost here is
applied to the whole query, not just a specific field. How could I
specify the boost for a field in this type of query?
On Mon, Apr 11, 2011 at 10:54 AM, Enrique Medina Montenegro e.medina.m@gmail.com wrote:
Thanks a lot!
In the meantime, I was searching the custom_score_query, but I just cannot
make the query work (I send it but I never get a response back, and there's
nothing in the logs). Do you know what could be wrong with this query? MVEL for script in custom_score_query · GitHub
On Mon, Apr 11, 2011 at 10:36 AM, Clinton Gormley clinton@iannounce.co.uk
wrote:
Hi Enrique
I'm currently using "query_string" for my queries, but boost here is
applied to the whole query, not just a specific field. How could I
specify the boost for a field in this type of query?
I tried your query, but it doesn't do anything, i.e. I'm using
elasticsearch-head JS client, and it displays requesting... but I never get
a response back.
Any clue?
Regards.
On Mon, Apr 11, 2011 at 11:04 AM, Ludovic Levesque luddic@gmail.com wrote:
On Mon, Apr 11, 2011 at 10:54 AM, Enrique Medina Montenegro e.medina.m@gmail.com wrote:
Thanks a lot!
In the meantime, I was searching the custom_score_query, but I just
cannot
make the query work (I send it but I never get a response back, and
there's
nothing in the logs). Do you know what could be wrong with this query? MVEL for script in custom_score_query · GitHub
On Mon, Apr 11, 2011 at 10:36 AM, Clinton Gormley < clinton@iannounce.co.uk>
wrote:
Hi Enrique
I'm currently using "query_string" for my queries, but boost here is
applied to the whole query, not just a specific field. How could I
specify the boost for a field in this type of query?
On Mon, Apr 11, 2011 at 11:11 AM, Enrique Medina Montenegro < e.medina.m@gmail.com> wrote:
Ludovic,
I tried your query, but it doesn't do anything, i.e. I'm using
elasticsearch-head JS client, and it displays requesting... but I never get
a response back.
Any clue?
Regards.
On Mon, Apr 11, 2011 at 11:04 AM, Ludovic Levesque luddic@gmail.comwrote:
On Mon, Apr 11, 2011 at 10:54 AM, Enrique Medina Montenegro e.medina.m@gmail.com wrote:
Thanks a lot!
In the meantime, I was searching the custom_score_query, but I just
cannot
make the query work (I send it but I never get a response back, and
there's
nothing in the logs). Do you know what could be wrong with this query? MVEL for script in custom_score_query · GitHub
On Mon, Apr 11, 2011 at 10:36 AM, Clinton Gormley < clinton@iannounce.co.uk>
wrote:
Hi Enrique
I'm currently using "query_string" for my queries, but boost here is
applied to the whole query, not just a specific field. How could I
specify the boost for a field in this type of query?
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.