gpt4 book ai didi

Elasticsearch 6.2 按数组搜索每个项目

转载 作者:行者123 更新时间:2023-12-03 00:00:26 25 4
gpt4 key购买 nike

我有这样的数组集,

"title": "Living furniture exhibitions!"
"include_products": ["ikea chair", "marketO desk"]

我试着像这样搜索。
{
"query": {
"multi_match": {
"query": "ikea desk",
"operator": "and"
}
}
}

我不想要任何搜索结果。但是,它通过 [" ikea 椅子"、"marketO 办公 table "] 进行搜索。

如何搜索 include_products 数组中的每个项目?

另外,我的映射设置是这样的,
"mappings": {
"information" : {
"properties" : {
"title" : {
"type" : "text"
},
"include_products": {
"type": "text"
}
},
"_all": {
"enabled": false
}
}
}

最佳答案

试试这个

{
"query":{
"bool":{
"must":[
{
"match_phrase":{
"include_products":"ikea desk"
}
}
]
}
}
}

关于Elasticsearch 6.2 按数组搜索每个项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49605675/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com