2017-11-20 4 views
0

Ich benutze solr 7.1.0, und ich möchte die tf bekommen, idf Werte mit in einer Abfrage, so dass eine die Abfrage senden mit:Verwendung tf func fl Parameter bekam Ausnahme

http://192.168.0.127:8983/solr/law/select?fl=tf(content,2005)&q=*:*&wt=xml 

aber bekam ich eine Ausnahme:

<?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> 

ist einige jar Bibliothek libs dir kopieren müssen? oder etwas, das ich vermisse?

BTW, die docfreq und termfreq arbeitet.

+2

Überprüfen Sie die Protokollserverseite für Solr den tatsächlichen Fehler zu bekommen - aber versuchen 'tf (Inhalt,‚2005‘)' - also mit Anführungszeichen um den Begriff Sie suchen nach oben (.. wie das ist, wie es in der verwendet wird Dokumentation zumindest, aber Solr nimmt in der Regel beide Formen ..) – MatsLindh

+0

log zeigen mir die tatsächliche Ausnahme: 2017.11.20 09: 48: 57,810 ERROR (qtp947679291-18) [c: Gesetz s: shard2 r: core_node4 x: law_shard2_replica_n2] oassHttpSolrCall null: java.lang.UnsupportedOperationException: erfordert eine TFIDFSimilarity (wie ClassicSimilarity) verwende ich bin/solr -c einen solrcloud Dienst starten, nachdem gesetzt <Ähnlichkeit class = "solr.BM25SimilarityFactory" /> in configsets/_default/config/Managed-Schema, bekomme ich immer noch diese Ausnahme. – KevinJiang

Antwort

0

this is the answer, die folgende in schema.xml oder Managed-Schema (solr Wolke) hinzuzufügen.

<similarity class="solr.ClassicSimilarityFactory"/> 

BM25Similarity ist nicht Unterklasse von TFIDFSimilarity, so solr.BM25SimilarityFactory nicht korrekt ist.

Danke MatsLindh!

Verwandte Themen