RavenDB:在 Embedded/RunInMemory 模式下如何查找/使用自定义分析器? [英] RavenDB: How do I find/use custom Analyzers when in Embedded/RunInMemory mode?

查看:68
本文介绍了RavenDB:在 Embedded/RunInMemory 模式下如何查找/使用自定义分析器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用这个字母数字分析器 在我的 RavenDB 实现中.我让它在我的临时环境(实际的 RavenDB 服务器安装)中工作,但是在我的开发环境(VS2013)中运行单元测试时遇到了问题.我在单元测试期间创建了索引,但当 RavenDB 无法找到自定义分析器时,它们的创建失败.

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.

我知道对于已安装的 RavenDB 服务器,您将编译后的 DLL 放在 \Analyzers\ 中并重新启动服务器以识别分析器.但是,当 RavenDB DocumentStore 从 EmbeddableDocumentStore 在内存中运行时,我如何实现这一点?我已经尝试在我项目的 \bin\Debug\ 的几个地方创建一个包含 DLL 的 \Analyzers\ 目录,但这似乎没有做任何事情.

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.

我花了几个小时浏览 RavenDB 文档,并在 Google 搜索结果中无济于事.如果答案在某处发布,它似乎非常隐蔽且难以找到.

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.

推荐答案

只需从您的测试项目中添加对分析器程序集的引用.它在哪个目录中无关紧要.假设您的索引使用分析器和程序集的全限定名称,它应该选择它.

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.

这篇关于RavenDB:在 Embedded/RunInMemory 模式下如何查找/使用自定义分析器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆