Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script filtering on nested field #23712

Closed
sergpsu opened this issue Mar 23, 2017 · 1 comment
Closed

Script filtering on nested field #23712

sergpsu opened this issue Mar 23, 2017 · 1 comment

Comments

@sergpsu
Copy link

sergpsu commented Mar 23, 2017

I'm trying to use following script filter:

"query":{
"bool":{
"must":{
"script":{
"script":{
"doc.containsKey('MEMBERS')"
}
}
}
}
}

and this does not give any result. If I replace MEMBERS with LAST_MESSAGE_DATE the query works as expected. I have thousands of documents with MEMBERS so the query really does not work as expected.
Elasticsearch version 5.1.2

Mapping

"mappings" : {
      "CONV" : {
        "properties" : {
          "LAST_MESSAGE_DATE" : {
            "type" : "long"
          },
          "MEMBERS" : {
            "type" : "nested",
            "properties" : {
              "ID" : {
                "type" : "long"
              },
              "LEFT" : {
                "type" : "long"
              },
              "NICK" : {
                "type" : "keyword"
              },
              "READ" : {
                "type" : "long"
              }
            }
          },
          "MESSAGES" : {
            "type" : "nested",
            "properties" : {
              "DATE" : {
                "type" : "long"
              },
              "FROM_ID" : {
                "type" : "long"
              },
              "NICK" : {
                "type" : "keyword"
              },
              "TEXT" : {
                "type" : "text"
              }
            }
          }
        }
      }
    }
  }
@rjernst
Copy link
Member

rjernst commented Mar 23, 2017

I see that you previously created a discuss thread, but waited only a few hours before creating this github issue. Elastic uses github for feature requests and confirmed bug reports. Please use the forum, and be patient.

Note that while I don't think this is a bug, I do think the situation can be improved to be more transparent, so I have opened
#23719.

@rjernst rjernst closed this as completed Mar 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants