mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-19 13:19:42 +02:00
update
This commit is contained in:
parent
6db7fc876c
commit
e15a5e8a85
2 changed files with 6 additions and 8 deletions
|
@ -61,11 +61,7 @@ class Search {
|
|||
throw error;
|
||||
}
|
||||
|
||||
const searchWords = searchString
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(/\s+/g, ' ')
|
||||
.split(' ');
|
||||
const searchWords = this.splitTextToWords(searchString);
|
||||
|
||||
const goodPages = (await this.getPagesByWords(searchWords))
|
||||
.slice(0, 10);
|
||||
|
@ -182,9 +178,9 @@ class Search {
|
|||
private getBlockRatio(block: any) {
|
||||
switch (block.type) {
|
||||
case 'header':
|
||||
return 6;
|
||||
return 8;
|
||||
case 'paragraph':
|
||||
return 2;
|
||||
return 1.1;
|
||||
case 'list':
|
||||
return 1;
|
||||
default:
|
||||
|
@ -240,6 +236,8 @@ class Search {
|
|||
// remove multiple spaces
|
||||
.replace(/\s+/g, ' ')
|
||||
|
||||
.trim()
|
||||
|
||||
// split to words by spaces
|
||||
.split(' ')
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ export default class Search {
|
|||
* - type a search string
|
||||
* - fire search
|
||||
*/
|
||||
// const testString = 'api method';
|
||||
// const testString = 'access editor';
|
||||
// this.toggleSearchOverlay(true);
|
||||
// this.nodes.searchInput.value = testString;
|
||||
// this.debouncedSearch(testString);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue