Closed SerratedSharp closed 7 months ago
Hrm, this is a rather interesting question. Examine currently doesn't use Thread.Start but uses a queue of Tasks to perform the indexing. Lucene itself however I believe is quite dependent on Threads but this potentially depends on what is happening.
I think in this case you are correct and that it is the NRT functionality.
To be able to toggle this functionality in Examine will require some feature updates. We can add a boolean to LuceneIndexOptions to enable/disable NRT but this will have some cascading effects through the indexer along with adding a bunch more unit tests to ensure that the behavior between non-NRT and NRT has the expected results.
Thanks, if it's infeasible I understand. I was able to directly use Lucene.NET library instead and create/get IndexWriter/IndexSearcher's. So I will go that route for now. Thank you.
Thanks, i'll close this for now but will look at creating this type of feature in the future.
Thanks, i'll close this for now but will look at creating this type of feature in the future.
FYI While researching I saw some discussion about adding multithreaded support for WASM: https://github.com/dotnet/runtime/issues/68162#issuecomment-1915098496
There'll probably be caveats even when supported, but it's possible this will just work in time.
When in a .NET WASM project, Thread.Start() is not allowed. I believe
_nrtReopenThread.Start();
in LuceneIndex.CreateSearcher() is doing this. I'm inside a using block.WithThreadingMode(IndexThreadingMode.Synchronous)
, but I take it that only affects indexing, and not searching.Is there a work around that would allow me to perform searches synchrounously without threading?