Skip to content

Commit

Permalink
Rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
Viatorus committed Mar 27, 2018
1 parent 9cf899e commit ad7c287
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 32 deletions.
16 changes: 9 additions & 7 deletions config/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ function merge() {
"prerelease": false
};
run("curl", ["--request", "POST", "--data", JSON.stringify(release),
`https://${GH_TOKEN}@api.github.com/repos/${TRAVIS_REPO_SLUG}/releases`]);
}

function update_documentation() {
print("====== Update documentation");
Expand All @@ -157,10 +159,9 @@ function build() {

print(`====== BUILDING: Version ${VERSION} (${CURRENT_COMMIT})`);

const README = `${ROOT_DIR}/README.md`;

const DOC_DIR = `${ROOT_DIR}/docs/js/@lokijs`;
mkdir(DOC_DIR);
const README = path.join(ROOT_DIR, "README.md");
const DOC_DIR = path.join(ROOT_DIR, "docs", "js", "@lokidb");
make_dir(DOC_DIR);

for (const PACKAGE of PACKAGES) {

Expand All @@ -169,9 +170,11 @@ function build() {
const SRC_WEBPACK_CONFIG = path.join(SRC_DIR, "webpack.config.js");
const OUT_DIR = path.join(ROOT_DIR, "dist", "packages", PACKAGE);
const OUT_DIR_FILENAME = path.join(OUT_DIR, `lokidb.${PACKAGE}.js`);
const OUT_DIR_FILENAME_MINIFIED = path.join(OUT_DIR, `lokidb.${PACKAGE}.min.js`);
const FILENAME_MINIFIED = `lokidb.${PACKAGE}.min.js`;
const OUT_DIR_FILENAME_MINIFIED = path.join(OUT_DIR, FILENAME_MINIFIED);
const NPM_DIR = path.join(ROOT_DIR, "dist", "packages-dist", PACKAGE);
const NPM_PACKAGE_JSON = path.join(NPM_DIR, "package.json");
const DOC_DIR_FILENAME_MINIFIED = path.join(DOC_DIR, FILENAME_MINIFIED);

print(`====== [${PACKAGE}]: PACKING =====`);
remove_dir(OUT_DIR);
Expand Down Expand Up @@ -216,8 +219,7 @@ function build() {

print(`====== [${PACKAGE}]: MINIFY =====`);
run("node", [UGLIFYJS, OUT_DIR_FILENAME, "--output", OUT_DIR_FILENAME_MINIFIED]);
// Copy minified to docs.
catch.cp(OUT_DIR_FILENAME_MINIFIED, DOC_DIR_FILENAME_MINIFIED);
copy(OUT_DIR_FILENAME_MINIFIED, DOC_DIR_FILENAME_MINIFIED);

print(`====== [${PACKAGE}]: VERSIONING =====`);
const data = fs.readFileSync(NPM_PACKAGE_JSON);
Expand Down
10 changes: 1 addition & 9 deletions docs/example/fts-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,9 @@

// Create database.
const loki = new Loki();
const tk = new LokiFullTextSearch.Tokenizer();
tk.setSplitter("whitespace", (str) => {
let tokens = str.split(/[^\S]+/);
for (let i = 0; i < tokens.length; i++) {
tokens[i] = tokens[i].toLowerCase();
}
return tokens;
});

// Fill collection with empty data.
const coll = loki.addCollection("test", {fullTextSearch: [{field: "txt", tokenizer: tk}]});
const coll = loki.addCollection("test", {fullTextSearch: [{field: "txt"}]});
for (let i = 0; i < 5; i++) {
coll.insert({txt: ""});
}
Expand Down
12 changes: 6 additions & 6 deletions docs/full-text-search.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Introduction

LokiJS provides a fast and powerful open-source full-text search engine.
LokiDB provides a fast and powerful open-source full-text search engine.

The engine can be used with the LokiJS database to perform full-text
The engine can be used with the LokiDB database to perform full-text
searches over a collection. In addition, the combination enables an easy
document and persistence management since this is already handled by the
database itself.
Expand Down Expand Up @@ -94,7 +94,7 @@ Check out section [Analyzer](#analyzer) to control which and how words should be

# Quick Start

The library functionality can be imported with `import {<...>} from "@lokijs/full-text-search`.
The library functionality can be imported with `import {<...>} from "@lokidb/full-text-search`.
If the library is included directly with a html-script tag, the global variable `LokiFullTextSearch` is available.

- FullTextSearch (default exported)
Expand Down Expand Up @@ -124,7 +124,7 @@ const result = fts.search(query);
cout(result);
```

## With LokiJS
## With LokiDB

```javascript
// Runnable code
Expand Down Expand Up @@ -198,7 +198,7 @@ const query = {
}
```

Via the property `$fts` the queries of the full-text search can be used in conjunction with the queries of LokiJS.
Via the property `$fts` the queries of the full-text search can be used in conjunction with the queries of LokiDB.

```js
// Finds all documents with the field age greater than 25
Expand All @@ -221,7 +221,7 @@ coll.find({
Please note that the search time of a full-text search query will not decrease because of a reduced document selection
from a previous query. Each query (if caching is disabled) will always browse the whole inverted index.

As opposed to this, non-indexed queries (like LokiJS' queries) could speed up because of fewer documents after a
As opposed to this, non-indexed queries (like LokiDB' queries) could speed up because of fewer documents after a
full-text search query.

# Scoring
Expand Down
20 changes: 10 additions & 10 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ extra_javascript:
- js/codemirror/addon/fold/foldgutter.js
- js/codemirror/addon/edit/matchbrackets.js
- js/codemirror/mode/javascript/javascript.js
- js/@lokijs/lokijs.fs-storage.min.js
- js/@lokijs/lokijs.full-text-search.min.js
- js/@lokijs/lokijs.full-text-search-language.min.js
- js/@lokijs/lokijs.full-text-search-language-de.min.js
- js/@lokijs/lokijs.full-text-search-language-en.min.js
- js/@lokijs/lokijs.indexed-storage.min.js
- js/@lokijs/lokijs.local-storage.min.js
- js/@lokijs/lokijs.loki.min.js
- js/@lokijs/lokijs.memory-storage.min.js
- js/@lokijs/lokijs.partitioning-adapter.min.js
- js/@lokidb/lokidb.fs-storage.min.js
- js/@lokidb/lokidb.full-text-search.min.js
- js/@lokidb/lokidb.full-text-search-language.min.js
- js/@lokidb/lokidb.full-text-search-language-de.min.js
- js/@lokidb/lokidb.full-text-search-language-en.min.js
- js/@lokidb/lokidb.indexed-storage.min.js
- js/@lokidb/lokidb.local-storage.min.js
- js/@lokidb/lokidb.loki.min.js
- js/@lokidb/lokidb.memory-storage.min.js
- js/@lokidb/lokidb.partitioning-adapter.min.js


theme: readthedocs

0 comments on commit ad7c287

Please sign in to comment.