|
@@ -153,6 +153,12 @@ class BoltService {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ getKeywords(args) {
|
|
|
|
|
+ const keywordsArr = args.slice(1);
|
|
|
|
|
+ const keywords = keywordsArr.join(' ');
|
|
|
|
|
+ return keywords;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
async getSearchResultPaths(command, args, offset = 0) {
|
|
async getSearchResultPaths(command, args, offset = 0) {
|
|
|
const firstKeyword = args[1];
|
|
const firstKeyword = args[1];
|
|
|
if (firstKeyword == null) {
|
|
if (firstKeyword == null) {
|
|
@@ -166,11 +172,7 @@ class BoltService {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const keywordsArr = [];
|
|
|
|
|
- for (let i = 1; i < args.length; i++) {
|
|
|
|
|
- keywordsArr.push(args[i]);
|
|
|
|
|
- }
|
|
|
|
|
- const keywords = keywordsArr.join(' ');
|
|
|
|
|
|
|
+ const keywords = this.getKeywords(args);
|
|
|
|
|
|
|
|
const { searchService } = this.crowi;
|
|
const { searchService } = this.crowi;
|
|
|
const options = { limit: 10, offset };
|
|
const options = { limit: 10, offset };
|
|
@@ -210,15 +212,17 @@ class BoltService {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
- resultPaths, offset, keywords, resultsTotal,
|
|
|
|
|
|
|
+ resultPaths, offset, resultsTotal,
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async showEphemeralSearchResults(command, args, offsetNum) {
|
|
async showEphemeralSearchResults(command, args, offsetNum) {
|
|
|
const {
|
|
const {
|
|
|
- resultPaths, offset, keywords, resultsTotal,
|
|
|
|
|
|
|
+ resultPaths, offset, resultsTotal,
|
|
|
} = await this.getSearchResultPaths(command, args, offsetNum);
|
|
} = await this.getSearchResultPaths(command, args, offsetNum);
|
|
|
|
|
|
|
|
|
|
+ const keywords = this.getKeywords(args);
|
|
|
|
|
+
|
|
|
if (resultPaths == null) {
|
|
if (resultPaths == null) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|