我刚刚安装了 Solr,我现在正在尝试学习如何使用它。我想用 Solr Cell和 langid功能,所以我遵循了链接的教程。 Solr Cell 有效,但我无法懒惰地做任何事情。
在 solrconfig.xml
, 我有这个:
<updateRequestProcessorChain name="langid">
<processor class="org.apache.solr.update.processor.LangDetectLanguageIdentifierUpdateProcessorFactory">
<str name="langid.fl">text,title,subject,description</str>
<str name="langid.langField">language_s</str>
<str name="langid.fallback">en</str>
<bool name="langid.map">true</bool>
</processor>
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
(我也尝试过使用 Tika),然后我使用发送文档
curl "http://localhost:8983/solr/update/extract?literal.id=test&commit=true" -F "myfile=@test.xml"
但是当我查询时,
text:[* TO *]
把我的文件还给我,但 text_en:[* TO *]
没有; language_s
,即使我声明为已存储,也固执地缺席; *:word
即使有 "words"
也找不到任何东西所以它不会被阻止;我在日志中找不到任何内容。我最好的猜测是, langid 不运行,我不知道为什么。编辑 :找到答案:read more docs :p
由于 langid 被配置为一个更新请求处理器链,它需要被选中(它不是自动的)。所以,这有效:
curl "http://localhost:8983/solr/update/extract?literal.id=test&commit=true&update.chain=langid" -F "myfile=@test.xml"
最佳答案
找到答案:read more docs :p
由于 langid 被配置为一个更新请求处理器链,它需要被选中(它不是自动的)。所以,这有效:
curl "http://localhost:8983/solr/update/extract?literal.id=test&commit=true&update.chain=langid" -F "myfile=@test.xml"
关于solr - 无法在 Solr 4.0 中使懒惰的工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11666149/