![](/img/trans.png)
[英]How to store more than 10 digit number in javascript using the var?
[英]Elasticsearch - How to make JavaScript client response more than 10 items
我正在為Elasticsearch使用JavaScript客戶端 。 我對請求有疑問:
client.search({
index: applicationIndex,
type: applicationType,
body: {
query: {
match_all : {}
}
}
})
.then(function(res){
return {res: res};
});
它不返回超過10個項目。 如何退貨(實際上有21件商品)? 謝謝
在文檔中,它指出size
默認為10。將size
添加到搜索對象中,並將其值設置為21
。
嘗試這個
client.search({
index: applicationIndex,
type: applicationType,
size: 21,
body: {
query: {
match_all : {}
}
}
})
.then(function(res){
return {res: res};
});
您還可以使用“ from”參數添加“ size”一個來管理分頁:)
client.search({
index: applicationIndex,
type: applicationType,
size: 10,
from: 10,
body: {
query: {
match_all : {}
}
}
})
.then(function(res){
return {res: res};
});
在這里它將返回介於10和20之間的元素:)
玩一下Elasticsearch :)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.