update: added options to flexsearch

This commit is contained in:
ZanzyTHEbar 2023-01-12 23:09:30 +00:00
parent 679f0bc0aa
commit bd68486599
3 changed files with 21 additions and 1 deletions

5
package.json Normal file
View File

@ -0,0 +1,5 @@
{
"devDependencies": {
"@types/flexsearch": "^0.7.3"
}
}

View File

@ -2,9 +2,16 @@
import { SearchPlugin } from "vitepress-plugin-search"; import { SearchPlugin } from "vitepress-plugin-search";
import { defineConfig } from "vite"; import { defineConfig } from "vite";
// https://github.com/nextapps-de/flexsearch#options
var flexSearchIndexOptions = {
preset: "score",
cache: 1000,
context: true,
}
//default options //default options
var options = { var options = {
/* ...flexSearchIndexOptions, */ ...flexSearchIndexOptions,
previewLength: 62, previewLength: 62,
buttonLabel: "Search", buttonLabel: "Search",
placeholder: "Search docs", placeholder: "Search docs",

8
yarn.lock Normal file
View File

@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/flexsearch@^0.7.3":
version "0.7.3"
resolved "https://registry.yarnpkg.com/@types/flexsearch/-/flexsearch-0.7.3.tgz#ee79b1618035c82284278e05652e91116765b634"
integrity sha512-HXwADeHEP4exXkCIwy2n1+i0f1ilP1ETQOH5KDOugjkTFZPntWo0Gr8stZOaebkxsdx+k0X/K6obU/+it07ocg==