[英]How to get all documents in elasticsearch index using “*” in simple_query_string
I am passing the *
into the query to fetch all fields in index using the simple_query_string
script, but it returns only an empty result. 我将
*
传递到查询中,以使用simple_query_string
脚本获取索引中的所有字段,但它仅返回空结果。 Kindly guide me to solve this situation. 请指导我解决这种情况。 The formed query is:
形成的查询为:
{"query":{"simple_query_string":{"query":"*","fields":["_all"]}},"from":0,"size":5}
{ “查询”:{ “simple_query_string”:{ “查询”: “*”, “田”:[ “_所有”]}} “从”:0, “大小”:5}
If you want to get all available documents there's a dedicated query for that : 如果您想获取所有可用的文档,可以使用专门的查询 :
{ "match_all": {} }
{“ match_all”:{}}
For wildcard style match you would use : 对于通配符样式匹配,您可以使用:
{ "wildcard" : { "user" : "ki*y" } }
{“通配符”:{“用户”:“ ki * y”}}
Check more info on wildcard queries here . 在此处检查有关通配符查询的更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.