Solr 在fl参数中使用tf func获得异常

Solr 在fl参数中使用tf func获得异常,solr,Solr,我使用solr 7.1.0,我希望在查询中获得tf、idf值,因此a使用以下参数发送查询: http://192.168.0.127:8983/solr/law/select?fl=tf(content,2005)&q=*:*&wt=xml 但是,我有一个例外: <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"> <bool n

我使用solr 7.1.0,我希望在查询中获得tf、idf值,因此a使用以下参数发送查询:

http://192.168.0.127:8983/solr/law/select?fl=tf(content,2005)&q=*:*&wt=xml
但是,我有一个例外:

<?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <bool name="zkConnected">true</bool>
  <int name="status">500</int>
  <int name="QTime">12</int>
  <lst name="params">
    <str name="q">*:*</str>
    <str name="fl">tf(content, 2005)</str>
    <str name="wt">xml</str>
    <str name="_">1511167922616</str>
  </lst>
</lst>
<lst name="error">
  <lst name="metadata">
    <str name="error-class">org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException</str>
    <str name="root-error-class">org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException</str>
  </lst>
  <str name="msg">Error from server at http://192.168.0.127:8983/solr/law_shard2_replica_n2: Server Error

request: http://192.168.0.127:8983/solr/law_shard2_replica_n2/select</str>
  <str name="trace">org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://192.168.0.127:8983/solr/law_shard2_replica_n2: Server Error

request: http://192.168.0.127:8983/solr/law_shard2_replica_n2/select
    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:626)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:253)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:242)
    at org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1219)
    at org.apache.solr.handler.component.HttpShardHandler.lambda$submit$0(HttpShardHandler.java:172)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:188)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
</str>
  <int name="code">500</int>
</lst>
</response>

真的
500
12
*:*
tf(内容,2005年)
xml
1511167922616
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException
来自位于的服务器的错误http://192.168.0.127:8983/solr/law_shard2_replica_n2: 服务器错误
请求:http://192.168.0.127:8983/solr/law_shard2_replica_n2/select
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:位于的服务器出错http://192.168.0.127:8983/solr/law_shard2_replica_n2: 服务器错误
请求:http://192.168.0.127:8983/solr/law_shard2_replica_n2/select
位于org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:626)
位于org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:253)
位于org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:242)
位于org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1219)
位于org.apache.solr.handler.component.HttpShardHandler.lambda$submit$0(HttpShardHandler.java:172)
在java.util.concurrent.FutureTask.run(FutureTask.java:266)处
位于java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
在java.util.concurrent.FutureTask.run(FutureTask.java:266)处
位于com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
位于org.apache.solr.common.util.execututil$MDCAwareThreadPoolExecutor.lambda$execute$0(execututil.java:188)
位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
位于java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
运行(Thread.java:748)
500
是否有jar库需要复制到libs dir?还是我错过了什么

顺便说一句,docfreq和termfreq正在工作。

请将以下内容添加到schema.xml或托管模式(solr cloud)中


BM25Similarity不是TFIDFSimilarity的子类,因此solr.BM25SimilarityFactory不正确

谢谢大家!

,将以下内容添加到schema.xml或托管模式(solr cloud)中


BM25Similarity不是TFIDFSimilarity的子类,因此solr.BM25SimilarityFactory不正确


谢谢大家!

检查服务器端日志以获取Solr的实际错误-但请尝试
tf(content,'2005')
-即在您正在查找的术语周围加引号(…至少在文档中是这样使用的,但Solr通常接受这两种形式…)日志显示实际异常:2017-11-20 09:48:57.810错误(qtp947679291-18)[c:law s:shard2 r:core\u node4 x:law\u shard2\u replica\u n2]o.a.s.s.HttpSolrCall null:java.lang.UnsupportedOperationException:需要TFIDFSimilarity(例如ClassicSimilarity)我使用bin/solr-c启动solrcloud服务,在configsets/_default/config/managed schema中设置后,仍然会出现此异常。请检查服务器端日志中的solr以获取实际错误-但请尝试
tf(content,'2005')
-即在您正在查找的术语周围加上引号(…至少在文档中是这样使用的,但Solr通常接受这两种形式。)日志显示实际的异常:2017-11-20 09:48:57.810错误(qtp947679291-18)[c:law s:shard2 r:core\u node4 x:law\u shard2\u replica\u n2]o.a.s.HttpSolrCall null:java.lang.UnsupportedOperationException:需要TFIDF(比如ClassicSimilarity)我使用bin/solr-c启动solrcloud服务,在configsets/_default/config/managed schema中设置之后,我仍然得到这个异常。
<similarity class="solr.ClassicSimilarityFactory"/>