问题
I would like to make use of this Alphanumeric Analyzer in my RavenDB implementation. I have it working in my staging environment (actual RavenDB server installation), but I am having trouble when it comes to unit tests run in my development environment (VS2013). I have indexes I create during my unit tests, and their creation fails when RavenDB is unable to find the custom analyzer.
I understand that for an installed RavenDB server, you drop the compiled DLL in \Analyzers\ and restart the server for the analyzer to be recognized. However, how do I achieve this when the RavenDB DocumentStore is running in memory from an EmbeddableDocumentStore? I've tried creating an \Analyzers\ directory with the DLL in it in several places in my project's \bin\Debug\ but that didn't seem to do anything.
I have spent several hours going through the RavenDB documentation and assorted Google results to no avail. If the answer's published somewhere, it appears to be extremely buried and difficult to find.
回答1:
Just add a reference to the analyzer assembly from your test project. It doesn't matter what directory it's in. Assuming the analyzer is used by your index with the full qualified name of the assembly, it should pick it up.
来源:https://stackoverflow.com/questions/19502900/ravendb-how-do-i-find-use-custom-analyzers-when-in-embedded-runinmemory-mode