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

Consider Typesense as a search/suggest backend #188

Open
stefandesu opened this issue Nov 4, 2022 · 2 comments
Open

Consider Typesense as a search/suggest backend #188

stefandesu opened this issue Nov 4, 2022 · 2 comments

Comments

@stefandesu
Copy link
Member

I finally spent some time looking into improvements to the search backend (see #43) and among the ones I have tried, Typesense did an exceptionally good job. It has native support for infix search (enabled on a per-field basis) and is incredibly fast. Also the search results in my tests have always been very good. Importing the whole RVK with almost 800k concepts takes about a minute on my local machine, and results in a memory usage of only ~300 MB (note that only ~150k of those concepts are fully indexed for search; the others are combined concepts where I only indexed the identifier and notation) with full infix-enabled search on all identifiers, labels, and notes. Most search queries take less than 100 ms (which could probably be improved with better configuration and not enabling infix search on notes).

There is a test script here: https://github.com/stefandesu/minisearch-test/blob/typesense/typesense.js

We could also use this for efficient creator search in mappings (#170) and even for combining search with filtering (#144).

Right now, I'm not sure how to best integrate Typesense with jskos-server. Ideally, I would offer it as kind of an alternative search backend, but without requiring it for full functionality, but that would increase complexity a lot. If we replaced our current search backend (queries to the MongoDB) with Typesense, we would reduce code complexity, but add a dependency without which jskos-server would not work. I guess we need to evaluate pros and cons for this.

@stefandesu
Copy link
Member Author

stefandesu commented Nov 4, 2022

Some helpful links:

@stefandesu
Copy link
Member Author

I think the main issue is keeping the Typesense collection in sync with the data in MongoDB (if we only use Typesense to enhance search). There is a tool that makes it easier, but for us to be able to use it, we would need nested indexed fields which is currently in the Typesense release candidate (see typesense/typesense#227).

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