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

How to set the index location? #256

Open
sayedgt opened this issue Oct 25, 2021 · 3 comments
Open

How to set the index location? #256

sayedgt opened this issue Oct 25, 2021 · 3 comments
Labels

Comments

@sayedgt
Copy link

sayedgt commented Oct 25, 2021

By default examine creates a directory while indexing. The problem is if I want to create a library project and then want to share it across multiple project where same index is needed than I must need to set the index creation location. Otherwise when I will reference the dll project, examinee will create a separate index for that project only. How can I set this location?

@Shazwazza
Copy link
Owner

Lucene indexes cannot be shared by more than one process. If you want to host an index that is accessible by multiple processes, then you should host that index in a centralized location and use custom REST calls to query and/or write to the the index.

Alternatively, it is possible to replicate lucene indexes to other locations and have those other processes read them but that is mostly outside the scope of Examine. Some example code however, can be found in Examine. Examine ships with a custom directory factory: SyncedFileSystemDirectoryFactory which is a specialized directory factory for working with lucene on Azure web apps whereby the lucene index is run from the %temp% location while always syncing the index back to the main directory (network share in azure). Then on startup, if there is an index in the main directory, it is replicated to the %temp% directory and the indexes operate from there.

As a side note, ExamineX is a commercial project that is an implementation of Examine that uses Azure Search as the underlying index/search engine and since that is a 'search as a service' it means that the index can be accessed by multiple processes at once. https://examinex.online/

@wilsonchenbhs
Copy link

@Shazwazza I tried to find the answer in the related documents but I could not. How exactly we can configure the folder where store the index data?

@Shazwazza
Copy link
Owner

@wilsonchenbhs what version are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants