Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我所做的有意义的查询
GET /_search?q=2016
它在整个数据库中搜索并获取任何字段中包含“2016”的所有条目的结果。
q作为查询参数提供作为查询运行query string。所以你必须使用 java api Query String。您可以使用 :
q
query string
Query String
SearchResponse response = client.prepareSearch("index_name") .setTypes("type1Name") .setQuery(QueryBuilders.queryString("2016")) .execute() .actionGet();