Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: Can't resolve '@lokidb/full-text-search' #159

Closed
Wyzix33 opened this issue Jan 15, 2019 · 1 comment
Closed

Module not found: Error: Can't resolve '@lokidb/full-text-search' #159

Wyzix33 opened this issue Jan 15, 2019 · 1 comment

Comments

@Wyzix33
Copy link

Wyzix33 commented Jan 15, 2019

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/LokiJS-Forge/LokiDB/blob/master/CONTRIBUTING.md#question

Current behavior

Unable to test full-text-search

Environment


LokiDB version: @lokidb/loki@2.0.0-beta.8



Others:

I am trying to import

import loki from '@lokidb/loki';

import LokiFullTextSearch from '@lokidb/full-text-search';

and i'm getting

Module not found: Error: Can't resolve '@lokidb/full-text-search'

i can create new database with lokidb = new loki() but i'm unable to run this example for full-text-search

LokiFullTextSearch.register();

  const lokis = new loki();
  // Setup the collection with full-text search options.
  const coll = lokis.addCollection("test", { fullTextSearch: [{ field: "txt" }] });
  // Add documents.
  coll.insert([
    { txt: "Betty Botter some butter" },
    { txt: "But she said the butter’s bitter" },
    { txt: "If I put it in my batter, it will make my batter bitter" },
    { txt: "But a bit of better butter will make my batter better" },
    { txt: "So ‘twas better Betty Botter bought a bit of better butter" }
  ]);
  // Search.
  const query = {
    query: {
      type: "term",
      field: "txt",
      value: "butter"
    }
  };
  const result = coll.find({ $fts: query });
  console.log(result);

Thanks

@Wyzix33
Copy link
Author

Wyzix33 commented Jan 15, 2019

Solved ...
i had to npm install @lokidb/full-text-search

@Wyzix33 Wyzix33 closed this as completed Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant