我正在使用 Javascript API Client并希望在我的索引中返回 facets。我相信为索引打开了分面,因为 1. 我在 UI 中切换了开关 2. 我可以在仪表板中为我的索引使用分面。我使用以下参数设置索引:
var params = {
tagFilters: 'query',
aroundLatLngViaIP: true,
getRankingInfo: 1,
facets: "*"
};
但是,这会返回一个空的 facets 对象。如何接收具有所有可能的分面选项的分面对象?
最佳答案
您没有此查询的结果,因此缺少方面。
您也许可以在 this updated JSFiddle 上更轻松地看到它:
index.search(params).then(function(resp) {
count.innerText = resp.hits.length + ' results';
facets.innerText = JSON.stringify(resp.facets, null, 2);
response.innerText = JSON.stringify(resp, null, 2);
});
关于algolia facets 在 javascript API 客户端中返回空对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36310927/