Now I ran the query with explain = true. The results are the following:
Explain before the update:
"details": [
{
"value": 5.752348,
"description": "fieldWeight in 424, product of:",
"details": [
{
"value": 1,
"description": "tf(freq=1.0), with freq of:",
"details": [
{
"value": 1,
"description": "termFreq=1.0"
}
]
},
{
"value": 9.203756,
"description": "idf(docFreq=201, maxDocs=738240)"
},
{
"value": 0.625,
"description": "fieldNorm(doc=424)"
}
]
}
]
Update script (scriptLang = groovy, profileId = 1):
if (ctx._source.bookmarked_by == null) {
ctx._source.bookmarked_by = [profileId]
} else if (ctx._source.bookmarked_by.contains(profileId)) {
ctx.op = "none"
} else {
ctx._source.bookmarked_by += profileId
}
Explain after the update:
"details": [
{
"value": 5.749262,
"description": "fieldWeight in 0, product of:",
"details": [
{
"value": 1,
"description": "tf(freq=1.0), with freq of:",
"details": [
{
"value": 1,
"description": "termFreq=1.0"
}
]
},
{
"value": 9.198819,
"description": "idf(docFreq=202, maxDocs=738241)"
},
{
"value": 0.625,
"description": "fieldNorm(doc=0)"
}
]
}
]
- Query used with the explain:*
{
"query": {
"query_string": {
"fields": [
"name"
],
"query": "roger"
}
}
}
The inverse document frequency (idf) is changed after adding a new field
that is not used in the query. Also, it changed the "fieldWeight in 424"
and "fieldNorm(doc=424)" to "fieldWeight in 0" and "fieldNorm(doc=0)" (idk
if it changes something)
Can someone help me on how to not change the score of the document after
running the update? Note that the update creates a new field if it was not
found (== null), but this field is not used in the query
2015-01-05 13:35 GMT-02:00 Roger de Cordova Farias <
roger.farias@fontec.inf.br>:
The added field is an array of Integers, but we are not using it in the
query at all
We are not querying the _all field, it is disabled in our type mapping
Our query is something like this:
{
"query": {
"query_string": {
"fields": [
"name"
],
"query": "roger"
}
}
}
I ran this query. In the first result, I added a new field called
"bookmarked_by" with a numeric value. Then I ran the same query again. The
document in which I added the new field is no longer the first result
2014-12-26 17:34 GMT-02:00 Doug Turnbull <
dturnbull@opensourceconnections.com>:
Are you querying the _all field? How are you doing your searches?
Elasticsearch Platform — Find real-time answers at scale | Elastic
The _all field receives a copy of every field you index, so adding data
here could impact scores regardless of the source field.
Otherwise, fields are scored independently before being put together by
other queries like boolean queries or dismax. Are you using
boolean/dismax/etc over multiple fields?
-Doug
On Fri, Dec 26, 2014 at 11:59 AM, Ivan Brusic ivan@brusic.com wrote:
Use the field in a filter and not part of the query. Is this field free
text?
Ivan
On Dec 23, 2014 9:12 PM, "Roger de Cordova Farias" <
roger.farias@fontec.inf.br> wrote:
Hello
Our documents have metadata indexed with them, but we don't want the
metadata to interfere in the scoring
After a user searches for documents, they can bookmark them (what means
we add more metadata to the document), then in the next search with the
same query the bookmarked document appears in a lower (worse) position
Is there a way to completely ignore one or more specific fields in the
scoring of every query? as in indexing time or something?
Note that we are not using the metadata field in the query, but yet it
lowers the score of every query
We cannot set the "index" attribute of this field to "no" because we
are gonna use it in other queries
--
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/CAJp2533Rjjec4SwXe_p-0eHYkkyEegFyP9DUMGQfHhua8ZyMWQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAJp2533Rjjec4SwXe_p-0eHYkkyEegFyP9DUMGQfHhua8ZyMWQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.
--
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%3DcQAKsYquQJMbfztJ%2Ba2_jpi-fVG%3DvcnXYHS-7bKvaOX4hA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAKsYquQJMbfztJ%2Ba2_jpi-fVG%3DvcnXYHS-7bKvaOX4hA%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.
--
Doug Turnbull
Search & Big Data Architect
OpenSource Connections http://o19s.com
--
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/CALG6HL9ND_SWteSetZL9059WyGRZvJrO2k4PQ9FQ1zUFhjbsxw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CALG6HL9ND_SWteSetZL9059WyGRZvJrO2k4PQ9FQ1zUFhjbsxw%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.
--
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/CAJp2531gd_T5rRm2a4JsiGGwd2kQrmFxgiW0iAFMceL2PyzUWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.