Question on breaking change (boost) in 1.0.0.RC1 release


(Amit Soni) #1

Hi all - I have been going through the list of breaking changes in
1.0.0.RC1 and have a question regarding boosting of documents. I see
that "*Support
for document boosting via the _boost field has been removed from Lucene and
is deprecated in Elasticsearch as of v1.0.0.RC1. *"

http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/mapping-boost-field.html#function-score-instead-of-boost

Since I didnt really understand if there is a way one can still boost
documents during indexing, I wanted to check with this group. So if I
correctly understand there would be no mechanism to specify boost value of
the documents during indexing time. Is that right?

-Amit.

--
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/CAAOGaQJbeK0y%3DwzpKBQ7CMP2t_Et8j%3D4QXY6ggLisYLcKADZbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Ivan Brusic) #2

Judging by the commits, the functionality was only deprecated, not removed.

I believe there are many use cases where it makes sense to boost a document
at index time. The process only occurs once instead of every time during
queries.

That said, as the github issue says, document boosts are very confusing.
What it basically does behind the scenes is changing the field norm for
every field in the document. If you disable norms on a field, then that
document cannot boost on that field. The scoring becomes erratic and hard
to explain. You cannot disable length normalization on fields since that
would require the field norms, which are needed by the document boosts.
Overall it believe it is better to switch to custom scoring at query time.

Cheers,

Ivan

On Thu, Jan 16, 2014 at 11:47 AM, Amit Soni amitsoni29@gmail.com wrote:

Hi all - I have been going through the list of breaking changes in
1.0.0.RC1 and have a question regarding boosting of documents. I see that "*Support
for document boosting via the _boost field has been removed from Lucene and
is deprecated in Elasticsearch as of v1.0.0.RC1. *"

http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/mapping-boost-field.html#function-score-instead-of-boost

Since I didnt really understand if there is a way one can still boost
documents during indexing, I wanted to check with this group. So if I
correctly understand there would be no mechanism to specify boost value of
the documents during indexing time. Is that right?

-Amit.

--
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/CAAOGaQJbeK0y%3DwzpKBQ7CMP2t_Et8j%3D4QXY6ggLisYLcKADZbQ%40mail.gmail.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBHBCM7f%2BpZL7ZZ7d7HFzxqTr%3DO5begP%2BcK1JD7Rp3u2w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Jörg Prante) #3

You can continue to set up your document boost field (e.g. a numeric field
named "boost") with a document boost value, and use function score to use
it as a boost factor. That is, a function score script knows how to boost
correctly:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_boost_factor

Jörg

--
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/CAKdsXoGfj-C1w2B7mhFFRNJSG1SfAVPwZDnqUR08nh1XnzjytA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Amit Soni) #4

Thanks so much Jörg and Ivan.
Do you think I can use function score with any query? I use simple query
string query and wondering how this can be used along with that?

-Amit.

On Thu, Jan 16, 2014 at 2:57 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

You can continue to set up your document boost field (e.g. a numeric field
named "boost") with a document boost value, and use function score to use
it as a boost factor. That is, a function score script knows how to boost
correctly:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_boost_factor

Jörg

--
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/CAKdsXoGfj-C1w2B7mhFFRNJSG1SfAVPwZDnqUR08nh1XnzjytA%40mail.gmail.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAOGaQK%2BB9L5HQ6TnWY-Z09pR5p-k5L0apm6yaGmW1poGNFn%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Jörg Prante) #5

See this full example of document boosting with function score query, you
can use any query you like.

Jörg

--
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/CAKdsXoH9FY2xbNGK70Tg9%2B0k75TJmvwkhrcAUuWNDDNkOr%2BGqw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Amit Soni) #6

Thanks much Jörg, this is super helpful. I didn't realize we could wrap a
query inside function score query.

-Amit.

On Fri, Jan 31, 2014 at 1:31 AM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

See this full example of document boosting with function score query, you
can use any query you like.

https://gist.github.com/jprante/8728976

Jörg

--
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/CAKdsXoH9FY2xbNGK70Tg9%2B0k75TJmvwkhrcAUuWNDDNkOr%2BGqw%40mail.gmail.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAOGaQLeSNVQ_1xb1zUJHEYs2koifrOxsRGZXaeO%3DifUZGF8zQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #7