我想进行这样的搜索:
我试过了,但是效果不是很好。
GET /_search
{
"query":
{ "query_string":
{
"query": "Test*"
}
}
}
最佳答案
尝试使用通配符搜索。确保您要搜索的字段是text
字段。
{
"query": {
"query_string" : {
"query" : "*desc*"
}
}
}
如果要使用所有索引,可以像这样查询
curl -XGET 'http://localhost:9200/index1,index2/_search
PS:从性能 Angular 来看,这不是一个好主意,因为它会搜索索引中的所有字段。或者,您可以在查询字符串中使用
default_field
并指定该字段。
关于elasticsearch - Elasticsearch-如何在所有索引和文档中搜索词的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60304472/