热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Solr无法找到资源stopwords_en.txt-Solrcan'tfindresourcestopwords_en.txt

ImtryingtosetupSolr3.6.0withDjango-haystackBeta2.0.0.我正在尝试用Django-haystackBeta2.0.0来设置S

I'm trying to setup Solr 3.6.0 with Django-haystack Beta 2.0.0.

我正在尝试用Django-haystack Beta 2.0.0来设置Solr 3.6.0。

After running ./manage.py build_solr_schema and moving schema.xml to the conf directory, upon visiting http://localhost:8983/solr/admin, I receive an error exactly like the one produced in this thread.

跑后。/管理。py build_solr_schema和moving schema。xml到conf目录,访问http://localhost:8983/solr/admin时,我收到的错误与在此线程中生成的错误完全相同。

org.apache.solr.common.SolrException: No cores were created, please check the logs for errors

未创建内核,请检查日志中是否有错误

java.lang.RuntimeException: Can't find resource 'stopwords_en.txt' in classpath or 'solr/./conf/', cwd=/home/randall/startupsearch_live/apache-solr-3.6.0/example

. lang。运行时异常:无法找到资源的stopwords_en。txt'在类路径或'solr/。/ conf /”,慢性消耗病= / home /兰德尔/ startupsearch_live / apache-solr-3.6.0 /例子

At the bottom of the thread, a user mentions that schema.xml must be edited to match stopwords_en.txt to the /example/solr/conf/ directory, which I did both through a symbolic link and by editing all instances of stopwords.txt to /solr/conf/stopwords_en.txt in the generated schema.xml file. However, the same error persists, giving a slightly different output:

在线程的底部,用户会提到这个模式。必须编辑xml以匹配stopwords_en。txt到/example/solr/conf/目录,我通过符号链接和编辑所有stopwords实例来实现。txt / solr / conf / stopwords_en。生成模式中的txt。xml文件。但是,相同的错误仍然存在,输出略有不同:

java.lang.RuntimeException: Can't find resource '/solr/conf/stopwords_en.txt' in classpath or 'solr/./conf/', cwd=/home/randall/startupsearch_live/apache-solr-3.6.0/example

. lang。运行时异常:无法找到资源'/solr/conf/stopwords_en。txt'在类路径或'solr/。/ conf /”,慢性消耗病= / home /兰德尔/ startupsearch_live / apache-solr-3.6.0 /例子

What file must I edit to fix this problem?

我需要编辑什么文件来解决这个问题?

6 个解决方案

#1


7  

It can't find stopwords_en.txt file in the classpath. You should add stopwords_en.txt file into the solr/conf/ directory. You can find more information about stopwords here.

它找不到stopwords_en。类路径中的txt文件。你应该添加stopwords_en。txt文件到solr/conf/目录。你可以在这里找到更多关于停止的信息。

#2


6  

A better way is to find all occurrences of stopwords_en.txt in schema.xml and replace them with lang/stopwords_en.txt

更好的方法是查找所有stopwords_en的出现。三种模式。用lang/stopwords_en.txt替换它们

#3


2  

You have to put stopwords_en.txt in the path . Make a file name stopwords_en.txt and paste beside the schema.xml. I hope you know what stopword filter is used.....

你必须写上stopwords_en。路径中的txt。创建一个文件名stopwords_en。在schema.xml旁边粘贴txt。我希望你知道什么是秒针过滤器。

#4


1  

To combine all three of the above answers, you need the stopwords_en.txt as it begins testing for English language text

要组合上述三个答案,需要stopwords_en。txt作为它开始测试英语文本

From http://wiki.apache.org/solr/LanguageAnalysis#Stopwords

从http://wiki.apache.org/solr/LanguageAnalysis Stopwords

Stopwords affect Solr in three ways: relevance, performance, and resource utilization.

停止字在三个方面影响Solr:相关性、性能和资源利用。

From a relevance perspective, these extremely high-frequency terms tend to throw off the scoring algorithm, and you won't get very good results if you leave them. At the same time, if you remove them, you can return bad results when the stopword is actually important.

从相关性的角度来看,这些极其高频的术语往往会打乱评分算法,如果你离开了它们,你就不会得到很好的结果。同时,如果您删除它们,您可以在停止符实际上很重要时返回糟糕的结果。

From a performance perspective, if you keep stopwords, some queries (especially phrase queries) can be very slow.

从性能的角度来看,如果保留stopwords,一些查询(特别是短语查询)可能会很慢。

From a resource utilization perspective, if you keep stopwords, the index is much larger than if you remove them.

从资源利用的角度来看,如果保留stopwords,那么索引会比删除它们大得多。

One tradeoff you can make if you have the disk space: You can use CommonGramsFilter/CommonGramsQueryFilter instead of StopFilter. This solves the relevance and performance problems, at the expense of even more resource utilization, because it will form bigrams of stopwords to their adjacent words.

如果您有磁盘空间,您可以做一个权衡:您可以使用CommonGramsFilter/CommonGramsQueryFilter而不是StopFilter。这就解决了相关性和性能问题,以牺牲更多的资源利用为代价,因为它会将停词的bigrams和它们相邻的词组合在一起。

What you need to do is copy the original version located in the /conf/lang folder of your solr directory into just the /conf directory

您需要做的是将您的solr目录中的/conf/lang文件夹中的原始版本复制到/conf目录中!

cp PATH/TO/solr/conf/lang/stopwords_en.txt PATH/TO/solr/conf

#5


1  

In Solr 5 I got the same error. I had used the Solr zookeeper cli shell to upload my configuration. I had copied the contents of an existing solr config from the server/solr/configsets/basic_configs, but I somehow missed the lang directory.

在solr5中,我得到了同样的错误。我使用Solr zookeeper cli shell上传我的配置。我已经从服务器/solr/configsets/basic_configs中复制了现有solr配置的内容,但是不知何故我错过了lang目录。

The conf/lang directory contains stopwords_en.txt.

conf/lang目录包含stopwords_en.txt。

#6


0  

I had the same issue and it turns out that when I was created my stopwords_en.txt file I accidently created stopwords_en.txt.txt file. Recreating it as the correct .txt file solved the problem

我也有同样的问题,当我创建stopwords_en时。我不小心创建了stopwords_en.txt文件。txt文件。将它重新创建为正确的.txt文件解决了这个问题


推荐阅读
author-avatar
mobiledu2502862177
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有