nextapps-de / flexsearch

Next-Generation full text search library for Browser and Node.js
Apache License 2.0
12.49k stars 491 forks source link

Flexsearch stops working when electron app is packaged #401

Closed agustingroh closed 10 months ago

agustingroh commented 1 year ago

I am utilizing the Flexsearch library within an Electron app written in TypeScript. The app's versions are as follows:

The library works fine in the development environment. When the app is packaged the library stops working.

here is how I am importing the library const Index = require('flexsearch'); const index = new Index(getSearchConfig());

Error TypeError: p is not a constructor at i.Indexer.index

It seems like the Indexer constructor is not being recognized, resulting in this error.

ts-thomas commented 10 months ago

The property Indexer wasn't coming from FlexSearch, please give me a full value of getSearchConfig()

agustingroh commented 10 months ago

Hi @ts-thomas here is my configuration.

{
  depth: 1,
  bidirectional: 0,
  resolution: 9,
  minlength: 2,
  stemmer: getDefaultStemmer(),
}.

Am I missing something?

aizotov commented 9 months ago

What was the resolution here? Was this a valid bug that was fixed or a misconfiguration?