提交 3e5f22ce 编写于 作者: D DCloud_LXH

feat: uni-app search result include uniCloud

上级 5253cc24
......@@ -336,6 +336,12 @@
searchByAlgolia() {
const { searchParameters = {} } = this.options;
let categoryArr = [];
if (this.currentCategory.text === 'uni-app') {
categoryArr = [[`category:uni-app`, `category:uniCloud`]];
} else {
categoryArr = [`category:${this.currentCategory.text}`];
}
return searchClient(
Object.assign({}, this.options, {
query: this.searchValue || '',
......@@ -343,9 +349,10 @@
snippetLength: this.snippetLength,
searchParameters: {
...searchParameters,
facetFilters: [`lang:${this.$lang}`].concat(searchParameters.facetFilters || [], [
`category:${this.currentCategory.text}`,
]),
facetFilters: [`lang:${this.$lang}`].concat(
searchParameters.facetFilters || [],
categoryArr
),
},
transformItems: items =>
items.map(item => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册