Hello everyone,
I'm pretty new to ES, so I hope I won't be writing any blasfemity. In this
case please forgive me.
I have an ES index
{
"settings": {
"analysis": {
"analyzer": {
"de_analyzer": {
"type": "snowball",
"language": "German"
}
}
}
}
}
with an ES map
uselessF
The data, retrieved by a river from a mongodb instance, are in the form:
{
"someInfo1" : {
...
}
"someInfo1" : {
...
}
"someInfo1" : {
...
}
"importantInfo" : {
"field1": true,
"field2": 2123848121,
...
"magnetId": "stringId1",
"type": "stringType"
}
}
all data are correctly indexed by the river, but when I execute a query
with the terms filter in it I got no results, even though there are some
in the index, of this I'm sure (please notice in the query below that
importantInfo.importantFlag is not present in the map).
{
"query": {
"filtered": {
"query": {
"multi_match": {
"fields": [
"importantInfo.toBeSearched1^2",
"importantInfo.toBeSearched2"
],
"query": "peer"
}
},
"filter": {
"and": [
{
"term": {
"importantInfo.importantField": "stringField"
}
},
{
"term": {
"importantInfo.importantFlag": true
}
},
{ "terms" : {
"importantInfo.importantId": [ "stringId1", "stringId2" ]
} }
]
}
}
},
"size": 10,
"from": 0,
"fields": [
"importantInfo.toBeSearched1",
"importantInfo.toBeSearched2",
"importantInfo.importantId"
]
}
If I use the following query instead, I got some results that respect all
the filters
{
"query": {
"filtered": {
"query": {
"multi_match": {
"fields": [
"importantInfo.toBeSearched1^2",
"importantInfo.toBeSearched2"
],
"query": "peer"
}
},
"filter": {
"and": [
{
"term": {
"importantInfo.importantField": "stringField"
}
},
{
"term": {
"importantInfo.importantFlag": true
}
}
]
}
}
},
"size": 10,
"from": 0,
"fields": [
"importantInfo.toBeSearched1",
"importantInfo.toBeSearched2",
"importantInfo.importantId"
]
}
Also, when I use terms, for example, on importantField instead of
importantId I have correct results as well.
{
"query": {
"filtered": {
"query": {
"multi_match": {
"fields": [
"importantInfo.toBeSearched1^2",
"importantInfo.toBeSearched2"
],
"query": "peer"
}
},
"filter": {
"and": [
*{ "terms" : {
"importantInfo.importantField": [ "*stringField1", "
stringField2" ] } },
{
"term": {
"importantInfo.importantFlag": true
}
}
]
}
}
},
"size": 10,
"from": 0,
"fields": [
"importantInfo.toBeSearched1",
"importantInfo.toBeSearched2",
"importantInfo.importantId"
]
}
I'm trying hard to understand what could possibly go wrong with that
filter. The field is mapped exactly as the others, but it cannot be used to
filter results.
I'm setting up a script to simulate this behavior and I will post it here
soon as it'll be ready, but in the meantime maybe someone can spot some
error I've made or option I've missed.
thanks in advance
L
--
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/eb92d62d-db0c-4ab4-9aa3-3ae03de2b4b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.