Solr 可以加载原始 Lucene 索引吗? [英] Can a raw Lucene index be loaded by Solr?

查看:27
本文介绍了Solr 可以加载原始 Lucene 索引吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一些同事有一个大型 Java Web 应用程序,该应用程序使用使用 Lucene Java 构建的搜索系统.我想要做的是有一个很好的基于 HTTP 的 API 来访问那些现有的搜索索引.我以前使用过 Nutch,并且非常喜欢 OpenSearch 实现使其以 RSS 形式获取结果的简单性.

Some colleagues of mine have a large Java web app that uses a search system built with Lucene Java. What I'd like to do is have a nice HTTP-based API to access those existing search indexes. I've used Nutch before and really liked how simple the OpenSearch implementation made it to grab results as RSS.

我已经尝试在 solrconfig.xml 中设置 Solr 的 dataDir,希望它能愉快地获取现有的索引文件,但它似乎只是忽略了它们.

I've tried setting Solr's dataDir in solrconfig.xml, hoping it would happily pick up the existing index files, but it seems to just ignore them.

我的主要问题是:

可以使用 Solr 访问在别处创建的 Lucene 索引吗?或者可能有更好的解决方案?

推荐答案

我从来没有尝试过这个,但是你必须调整 schema.xml 以包含你的 Lucene 索引中的所有文档字段,因为 Solr不允许您搜索未在 schema.xml 中定义的字段.

I have never tried this, but you would have to adjust the schema.xml to include all the fields of the documents that are in your Lucene index, because Solr won't allow you to search for a field if it is not defined in schema.xml.

对 schema.xml 的调整还应包括定义查询时分析器以在您的字段中正确搜索,尤其是在使用自定义分析器索引的字段时.

The adjustment to schema.xml should also include defining the query-time analyzers to properly search in your field, especially if the field where indexed using custom analyzers.

在 solrconfig.xml 中,您可能需要更改 indexDefaults 和 mainIndex 部分中的设置.

In solrconfig.xml you may have to change settings in the indexDefaults and the mainIndex sections.

但我很乐意阅读真正做到这一点的人的答案.

But I'd be happy to read answers from people who actually did it.

这篇关于Solr 可以加载原始 Lucene 索引吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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