mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-08-13 01:24:15 +02:00
update examples
This commit is contained in:
@@ -8,6 +8,7 @@ npm install git+https://github.com/nextapps-de/flexsearch/tree/v0.8-preview
|
||||
|
||||
- Persistent indexes support for: `IndexedDB` (Browser), `Redis`, `SQLite`, `Postgres`, `MongoDB`, `Clickhouse`
|
||||
- Enhanced language customization via the new `Encoder` class
|
||||
- Result Highlighting
|
||||
- Query performance achieve results up to 4.5 times faster compared to the previous generation v0.7.x by also improving the quality of results
|
||||
- Enhanced support for larger indexes or larger result sets
|
||||
- Improved offset and limit processing achieve up to 100 times faster traversal performance through large datasets
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<title>Example: browser-legacy-basic-persistent</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script>
|
||||
<script>
|
||||
(async function(){
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<title>Example: browser-legacy-basic-resolver</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script>
|
||||
<script>
|
||||
|
||||
// create a simple index which can store id-content-pairs
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<title>Example: browser-legacy-basic-suggestion</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.light.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.light.min.js"></script>
|
||||
<script>
|
||||
|
||||
// create a simple index which can store id-content-pairs
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<title>Example: browser-legacy-basic-worker</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script>
|
||||
<script>
|
||||
(async function(){
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<title>Example: browser-legacy-basic</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.light.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.light.min.js"></script>
|
||||
<script>
|
||||
|
||||
// create a simple index which can store id-content-pairs
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<title>Example: browser-legacy-document-highlighting</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.compact.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.min.js"></script>
|
||||
<script type="module">
|
||||
|
||||
// some test data
|
||||
@@ -21,7 +21,6 @@
|
||||
// create the document index
|
||||
const index = new FlexSearch.Document({
|
||||
document: {
|
||||
id: "tconst",
|
||||
store: true,
|
||||
index: [{
|
||||
field: "title",
|
||||
@@ -48,8 +47,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(
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<title>Example: browser-legacy-document-persistent</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script>
|
||||
<script>
|
||||
(async function(){
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<title>Example: browser-legacy-document-worker</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.bundle.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.bundle.min.js"></script>
|
||||
<script>
|
||||
(async function(){
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<title>Example: browser-legacy-document</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.compact.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.min.js"></script>
|
||||
<script>
|
||||
|
||||
// some test data
|
||||
|
@@ -6,9 +6,9 @@
|
||||
<title>Example: browser-legacy-language-packs</title>
|
||||
</head>
|
||||
<body style="white-space: pre">
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/flexsearch.compact.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/flexsearch.compact.min.js"></script>
|
||||
<!-- Load language pack after loading the library -->
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/aff94f2b1d830e21463b237070f7e6f7eb556b82/dist/lang/en.min.js"></script>
|
||||
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/9e1b24a124c3d0065b4ddf5cea9d109aca2fb7d2/dist/lang/en.min.js"></script>
|
||||
<script>
|
||||
|
||||
const encoder = new FlexSearch.Encoder(
|
||||
|
@@ -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");
|
||||
|
@@ -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({
|
||||
|
@@ -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({
|
||||
|
@@ -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",
|
||||
|
@@ -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({
|
||||
|
@@ -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(
|
||||
|
@@ -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 = [{
|
||||
|
@@ -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",
|
||||
|
@@ -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",
|
||||
|
@@ -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 = [{
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user