2016-12-17 19 views

回答

2

在文檔中它指出size默認爲10.將size添加到您的搜索對象並將其值設置爲21

試試這個

client.search({ 
     index: applicationIndex, 
     type: applicationType, 
     size: 21, 
     body: { 
     query: { 
      match_all : {} 
     } 
     } 
    }) 
    .then(function(res){ 
     return {res: res}; 
    }); 
1

您還可以管理一個分頁「從」參數的「大小」的:)

client.search({ 
    index: applicationIndex, 
    type: applicationType, 
    size: 10, 
    from: 10, 
    body: { 
    query: { 
     match_all : {} 
    } 
    } 
}) 
.then(function(res){ 
    return {res: res}; 
}); 

這將返回10之間的元素加入20 :)

玩得開心elasticsearch :)

相關問題