简体   繁体   中英

Elasticsearch Term Filter on Array

I'm having trouble getting the Terms filter working for for an index.

Right now I'm searching:

"term" : { "tags" : "Dining"}

EDIT: assume that the query filters are in the right place as well, just pulling this from part of a script.

Assume that the tags item is an array of different tags a document may have. What I expected to result would be a list of documents with the tag "Dining". What actually happened is a result with 0 documents.

For mappings, it looks like this:

'tags' => [
    'type' => 'string',
    'index' => 'not_analyzed',
]

Is there a certain mappings I have to have on the array to make the Term Filter match it? Something wrong with the Term filter? I'm thinking I should change it to the Terms filter vs Term. Thanks in advance!

我意识到,自从我重新映射它以来,它一直在使用术语过滤器,而不是术语过滤器。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM