1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-08-29 08:40:45 +02:00

update examples

This commit is contained in:
Thomas Wilkerling
2025-03-14 22:21:02 +01:00
parent baf0faaf81
commit a975b063c7
22 changed files with 30 additions and 31 deletions

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre">
<script type="module">
import { Index, IndexedDB } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.module.min.js";
import { Index, IndexedDB } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js";
// create DB instance with namespace
const db = new IndexedDB("my-store");

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre">
<script type="module">
import { Index, Resolver } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.module.min.js";
import { Index, Resolver } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js";
// create a simple index which can store id-content-pairs
const index = new Index({

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre">
<script type="module">
import { Index } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.light.module.min.js";
import { Index } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.light.module.min.js";
// create a simple index which can store id-content-pairs
const index = new Index({

View File

@@ -1,4 +1,4 @@
import { Encoder } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.module.min.js";
import { Encoder } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js";
export default {
tokenize: "forward",

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre">
<script type="module">
import { Index } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.light.module.min.js";
import { Index } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.light.module.min.js";
// create a simple index which can store id-content-pairs
const index = new Index({

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre">
<script type="module">
import { Document, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.compact.module.min.js";
import { Document, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.module.min.js";
// some test data
const data = [{
@@ -22,7 +22,6 @@
// create the document index
const index = new Document({
document: {
id: "tconst",
store: true,
index: [{
field: "title",
@@ -49,8 +48,8 @@
});
// display results
console.log(suggestions);
log(JSON.stringify(suggestions, null, 2));
console.log(result);
log(JSON.stringify(result, null, 2));
function log(str){
document.body.appendChild(

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre">
<script type="module">
import { Document, Charset, IndexedDB } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.module.min.js";
import { Document, Charset, IndexedDB } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js";
// some test data
const data = [{

View File

@@ -1,5 +1,5 @@
import { Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.module.min.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/module/lang/en.js";
import { Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/module/lang/en.js";
export default {
tokenize: "forward",

View File

@@ -1,5 +1,5 @@
import { Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.module.min.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/module/lang/en.js";
import { Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.module.min.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/module/lang/en.js";
export default {
tokenize: "forward",

View File

@@ -8,7 +8,7 @@
<body style="white-space: pre">
<script type="module">
import { Document, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.compact.module.min.js";
import { Document, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.module.min.js";
// some test data
const data = [{

View File

@@ -8,8 +8,8 @@
<body style="white-space: pre">
<script type="module">
import { Index, Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.compact.module.min.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/module/lang/en.js";
import { Index, Encoder, Charset } from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.module.min.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/module/lang/en.js";
const encoder = new Encoder(
Charset.LatinSimple,