elasticsearch


Elastic bool-query inside filter-query has always zero score


I have a weird problem with my elastic query which I'm not able to figure out. I'm quite fresh to Elastic.
I have the following query to search through my index:
GET frow_local_commerce_master_a1/product/_search
{
"query": {
"bool": {
"should": [
{
"query_string": {
"default_field": "commercialCode",
"query": "*UE1406* OR UE1406~",
"allow_leading_wildcard": true,
"fuzziness": 2,
"default_operator": "OR",
"boost": 100
}
},
{
"query_string": {
"query": "*UE1406*",
"allow_leading_wildcard": true,
"fields": [
"range^2.0"
],
"default_operator": "OR"
}
},
{
"nested": {
"path": "localized",
"query": {
"query_string": {
"query": "*UE1406*",
"allow_leading_wildcard": true,
"fields": [
"localized.floorType^2.0",
"localized.productName^3.0"
],
"default_operator": "OR"
}
}
}
}
]
}
}
}
This works as expected. No problems at all, but the problem is that whenever I expand this main query with a filter query:
GET frow_local_commerce_master_a1/product/_search
{
"query": {
"bool": {
"filter": [
{
"term": {
"brand.keyword": {
"value": "QS"
}
}
},
{
"query": {
"bool": {
"should": [
{
"query_string": {
"default_field": "commercialCode",
"query": "*UE1406* OR UE1406~",
"allow_leading_wildcard": true,
"fuzziness": 2,
"default_operator": "OR",
"boost": 100
}
},
{
"query_string": {
"query": "*UE1406*",
"allow_leading_wildcard": true,
"fields": [
"range^2.0"
],
"default_operator": "OR"
}
},
{
"nested": {
"path": "localized",
"query": {
"query_string": {
"query": "*UE1406*",
"allow_leading_wildcard": true,
"fields": [
"localized.floorType^2.0",
"localized.productName^3.0"
],
"default_operator": "OR"
}
}
}
}
]
}
}
},
{
"nested": {
"query": {
"bool": {
"filter": [
{
"term": {
"localized.language.keyword": {
"value": "nl-BE"
}
}
}
]
}
},
"path": "localized"
}
}
]
}
}
}
As you can see this query is identical as the first query, but has a "query" -> "filter" above it. I need this because I need to filter on other attributes aswell next to my main search query.
The problem is that this query always has a _score 0. Whenever I run the first query, I have a normal score..
Does anyone have any idea why my _score is always zero when I execute the second query? And what can possibly be the solution?
Thanks in advance.

Related Links

Logstash extracting values from sp_executesql
Logstash Grok Modifying and overwriting #timestamp
how to restore elasticsearch.yml config file to original?
Index a graph with ElasticSearch
ElasticSearch query not returning expected results
Fluentd High Availability Custom Index
How do I add an attribute to an Elasticsearch node for the purpose of Shard Allocation Filtering?
Configure ElasticSearch attachment mapper to use OCR plugin
ElasticSearch: How to search for a value in any field, across all types, in one or more indices?
Phrase suggestor - which index and query to act upon
Adding additional fields to ElasticSearch terms aggregation
ElasticSearch multi_match if field exists apply filter otherwise dont worry about it?
ElasticSearch Date Histogram Interval
Kibana 4 index patterns time-field
elasticsearch: Did I lose data when two of my three nodes went down?
ElasticSearch automatic typing

Categories

HOME
list
keyboard
freeradius
activemq
visual-studio-2010
histogram
web2py
impala
lc3
jpa-2.0
rest-assured
gravity
exec-maven-plugin
gmp
nullreferenceexception
backtracking
altium-designer
gollum-wiki
mime-types
high-availability
morris.js
ruby-daemons
ccavenue
nic
python-2.x
knights-tour
sql-execution-plan
amazon-kms
django-crispy-forms
tidal-scheduler
linq.js
oauth2
microkernel
export-to-pdf
coverage.py
vungle-ads
zend-form
ipp-protocol
rm
lightning-workbench
ilrepack
android-sharing
watir-webdriver
multi-touch
carmen
ftp-client
perforce-integrate
right-to-left
meld
android-async-http
currency-exchange-rates
vim-plugin
deeplink
textpattern
ruby-on-rails-4.1
srv-record
css-paged-media
supercomputers
wlanapi
google-gdk
bootstrap-wysiwyg
relational-model
innerhtml
text-align
camus
nsmutabledata
flurry-analytics
dc
utf8-decode
window-resize
tabris
quantify
osascript
lumia-imaging-sdk
box2dweb
treeline
rails-api
property-injection
typesafe-stack
acitree
semicolon
tridion-2011
multiple-dispatch
nsmutablestring
clearinterval
monocross
firebird1.5
mmc3
snackjs
server-variables
django-pagination
iphone-sdk-4.3
.net-services
zend-test
html-components
subtext
eai
datagridcolumn

Resources

Encrypt Message