gpt4 book ai didi

elasticsearch - 创建elastic.js查询

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

长话短说。

我需要使用elasticjs创建一个类似物以进行查询:
http://example.com/one/two/_search?q=tags:three*
我对docs页面上列出的选项感到困惑。已经尝试创建BoolQueryTermQuery和其他几个,但是它们对我不起作用。

我现在陷入困境,并希望就此提供任何帮助。

附言和同一问题的另一面。我找不到json应该看起来如何获得相同的数据。到目前为止,已经提出了这个解决方案,但是不幸的是,它没有用:

{
"query": {
"bool": {
"should": [
{
"term": {
"tag": "three*"
}
}
]
}
}
}

最佳答案

ejs.Request()
.indices("one")
.types("two")
.query(ejs.QueryStringQuery ( "tags:three*" ))
.doSearch(function (data) {
// do something with data
});

附言在json中:
{
"query": {
"query_string": {
"query": "tags:three*"
}
}
}

要么
{
"query": {
"wildcard": {
"tags": "three*"
}
}
}

关于elasticsearch - 创建elastic.js查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15855479/

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