RavenDB: How do I find/use custom Analyzers when in Embedded/RunInMemory mode?

非 Y 不嫁゛ 提交于 2019-12-13 06:13:05

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!