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

Question: Can indexes of documents be saved for reuse later? #249

Closed
James-Hudson3010 opened this issue Jul 30, 2021 · 9 comments
Closed
Assignees

Comments

@James-Hudson3010
Copy link

In my use case, the document I would like to search will not change. I would like to be able to pass this document to Flexsearch, have it create an index, and then save that pre-computed index so I can pass both the document and index to Flexsearch and begin receiving results immediately.

Is this possible?

@ts-thomas
Copy link
Contributor

Flexsearch has an .export( ) method where you can store a serialized index, which could be imported via .import( ) later. Actually you need to enrich the IDs from the result with your document data. This is not automatically happened when you import an index yet. This is on my list for upcoming features "providing a simple workaround for restoring the full index including the document data".

@James-Hudson3010
Copy link
Author

I am not sure what you mean by "enrich the IDs from the result with the document data"? Can you expand on that?

@James-Hudson3010
Copy link
Author

Oh, looking at the documentation ( Document Search Options section ), I see:

enrich | Boolean | Enrich IDs from the results with the corresponding documents.

I am assuming you are referring to the need to use 'true' for the enrich value.

@jamienicholls
Copy link

I'm also having issues with exporting and importing document indexes, did you mange to get this to work @James-Hudson3010 ? I posted a question on Stack Overflow about my issue

@ishanuda
Copy link

ishanuda commented Nov 1, 2021

@jamienicholls
As I can see from the comment of the author above "This is on my list for upcoming features "providing a simple workaround for restoring the full index including the document data" it is still not working, and it will be added as a feature in the future releases.

@jamienicholls
Copy link

@ishanuda my bad, I miss read it.. Thanks for your reply :)

@lostdesign
Copy link

@jamienicholls i replied to your SO, cc @ishanuda / @James-Hudson3010 if you wanna know https://stackoverflow.com/questions/69760524/flexsearch-export-and-import-document-index-issue/69853828#69853828

@ishanuda
Copy link

ishanuda commented Nov 7, 2021

@lostdesign,
Hi,
For the time being its a good solution. Thank you for the reminder.

@ts-thomas ts-thomas self-assigned this Oct 2, 2022
@ts-thomas
Copy link
Contributor

This is now fixed in v0.7.23
Further improvements to provide Promise.all() compatible export ist coming in next version.

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

5 participants