Closed James-Hudson3010 closed 2 years ago
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".
I am not sure what you mean by "enrich the IDs from the result with the document data"? Can you expand on that?
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.
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
@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.
@ishanuda my bad, I miss read it.. Thanks for your reply :)
@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
@lostdesign, Hi, For the time being its a good solution. Thank you for the reminder.
This is now fixed in v0.7.23 Further improvements to provide Promise.all() compatible export ist coming in next version.
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?