AdamP
(AdamP)
December 18, 2013, 8:10pm
1
Hi,
I'm trying to search the _all field and I'm finding that the field boosts
aren't reflected in the score each document receives.
According to the Elasticsearch documentation:
"One of the nice features of the _all field is that it takes into account
specific fields boost levels. Meaning that if a title field is boosted more
than content, the title (part) in the _all field will mean more than the
content (part) in the _all field."
When I do a query, I'm getting the same score for each document, regardless
of the boost. This seems to have something to do with my custom analyzers.
If I use the standard analyzer, the boost works correctly.
Here's my mapping, data, and query. I'm searching for the word "test".
Since field1 has a large boost, the document containing the word "test" in
field1 should have a higher score right?
Adding data
#!/bin/bash
curl -XPOST 'http://localhost:9200/testing/type1/' -d '{
"id" : "1",
"field1" : "This is a test that I am running",
"field2" : "Hello world"
}'
curl -XPOST 'http://localhost:9200/testing/type1/' -d '{
"id" : "2",
"field1" : "Hello world",
"field2" : "This is a test that I am running"
This file has been truncated. show original
Query and Result
curl "localhost:9200/testing/type1/_search?pretty=true" -d '
{
"query" : {
"query_string": {
"default_field": "_all",
"query": "test"
}
}
}'
This file has been truncated. show original
Template
curl -XPUT localhost:9200/_template/test_template -d '
{
"template" : "test*",
"settings" : {
"index" : {
"number_of_shards" : 3,
"analysis" : {
"filter" : {
"simple_word_del_filter" : {
"type" : "word_delimiter",
This file has been truncated. show original
Thanks
--
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/d6e430e9-ceae-49ff-8d48-b621ffb513cc%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
For one thing, I am not sure about the reason for using different analyzers
for indexing as for searching. I always use the same analyzer for both.
I've also only seen the _all field enabled via: "_all" : {"enabled" : true} and
never with any analyzers of its own.
Not sure if this helps; I hope it does.
Regards,
Brian
--
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/3cf011de-6bf3-4e28-ba2e-f280d592574a%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
spinscale
(Alexander Reelsen)
December 19, 2013, 2:56pm
3
Hey,
can you test with elasticsearch 0.90.8? There was bug fixed recently about
a similar issue: Per-field boosting of the _all field is broken unless very specific conditions are met · Issue #4315 · elastic/elasticsearch · GitHub
--Alex
On Wed, Dec 18, 2013 at 9:50 PM, InquiringMind brian.from.fl@gmail.com wrote:
For one thing, I am not sure about the reason for using different
analyzers for indexing as for searching. I always use the same analyzer for
both.
I've also only seen the _all field enabled via: "_all" : {"enabled" : true
} and never with any analyzers of its own.
Not sure if this helps; I hope it does.
Regards,
Brian
--
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/3cf011de-6bf3-4e28-ba2e-f280d592574a%40googlegroups.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/CAGCwEM8R7WbCqpfQ9Bp2BLpHZgJN2crayV9BFt8iaR%2BbR%3DqHjg%40mail.gmail.com .
For more options, visit https://groups.google.com/groups/opt_out .
AdamP
(AdamP)
December 19, 2013, 3:15pm
4
That was the issue.
Thanks!
On Thursday, December 19, 2013 9:56:04 AM UTC-5, Alexander Reelsen wrote:
Hey,
can you test with elasticsearch 0.90.8? There was bug fixed recently about
a similar issue:
Per-field boosting of the _all field is broken unless very specific conditions are met · Issue #4315 · elastic/elasticsearch · GitHub
--Alex
On Wed, Dec 18, 2013 at 9:50 PM, InquiringMind <brian....@gmail.com <javascript:>
wrote:
For one thing, I am not sure about the reason for using different
analyzers for indexing as for searching. I always use the same analyzer for
both.
I've also only seen the _all field enabled via: "_all" : {"enabled" :
true} and never with any analyzers of its own.
Not sure if this helps; I hope it does.
Regards,
Brian
--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/3cf011de-6bf3-4e28-ba2e-f280d592574a%40googlegroups.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/5a118321-ffda-4266-af6b-8884b18715af%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .