简体   繁体   English

SOLR在搜索时选择索引

[英]SOLR choose index at search

I posted this in the Nabble group also, but figured may get some advice here. 我也将此文章发布在Nabble小组中,但想知道这里可能会提供一些建议。

is there a way to get SOLR to search whatever index i tell it to during search time without using multiple cores? 有没有办法让SOLR在搜索时间内搜索我告诉它的任何索引而无需使用多个核?

i dont build my indexes with SOLR, i build them with my own java class, but i do use SOLR to search them later. 我不使用SOLR构建索引,而是使用自己的Java类构建索引,但稍后会使用SOLR进行搜索。 It would be nice to tell Solr during search time which index to access. 最好在搜索期间告诉Solr要访问哪个索引。 I have combined them as well, and this works but there are a few issues in my particular case, that make it easier to solve with sending the index name/path at search. 我也将它们组合在一起,并且可行,但是在我的特殊情况下,存在一些问题,可以通过在搜索时发送索引名称/路径来解决。

thanks 谢谢

I don't really think you can really do what you are looking for here. 我真的不认为您可以真正在这里做您想要的。 Part of the simplicity of Solr comes from have the core (and therefore index) in the URL. Solr的部分简化来自URL中具有核心(因此具有索引)。 What you could do is hack how Solr works to add another parameter to the url and then when Solr goes to do a search use that to determine which index it uses. 您可以做的是弄清楚Solr如何将其他参数添加到url,然后在Solr进行搜索时使用它来确定它使用的索引。 I think you might end up throwing out all the auto warming of caches etc though. 我认为您可能最终会放弃所有对缓存等的自动预热。

Out of curiosity, why do you NOT want to use multiple cores? 出于好奇,您为什么不想使用多个内核? Is it that you expect to have thousands and thousands, or that each index is incredibly transient? 是您希望拥有成千上万的索引,还是每个索引都是难以置信的瞬态?

Eric 埃里克

You might want to look into Lucid Works' Enterprise Solr release. 您可能需要研究Lucid Works的Enterprise Solr版本。

http://www.lucidimagination.com/products/lucidworks-search-platform/enterprise http://www.lucidimagination.com/products/lucidworks-search-platform/enterprise

They implement Collections in a way that is similar to your use case. 他们以与您的用例相似的方式实现Collections。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM