简体   繁体   中英

elastic search GET/Multi GET vs idsquery

In which case would one use an idsquery instead of a GET? What is faster/better practice?

QueryBuilder qb = QueryBuilders.idsQuery("typeName").addIds("1");

vs:

GetResponse getResponse = transportClient.prepareGet("indexName", "typeName", "1").get();

Do I only use the addIdsquery to prefilter querys?

idsQuery您可以指定类型和ID的列表,而在简单的GET中,您只能获取一个文档 - 一种类型和一种ID - 我认为类型不是强制性的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM