我已经在我的solr集合中配置了LTR,我可以看到我的功能和模型文件。为了测试,我只保留了两个功能和一个非常基本的模型文件。我已经附加了这两个文件。我可以使用以下查询检索功能:
localhost:8983/solr/waterstest/query?q=:&fl=title,id,description,score,[features store=myWatersFeatureStore efi.boostedTitle=columns efi.boostedDescription=Heater]
上面的工作正常。我能够检索的功能和分数的数据
当我尝试用上传的模型对结果重新排序时,问题就出现了。
localhost:8983/solr/waterstest/query?q=title:columns&rq={!ltr model=myWatersModel reRankDocs=100 efi.boostedTitle=columns efi.boostedDescription=Heater}&fl=id,score
Response
{
"responseHeader":{
"zkConnected":true,
"status":400,
"QTime":28,
"params":{
"q":"title:columns",
"fl":"id,score",
"rq":"{!ltr model=myWatersModel reRankDocs=100 efi.boostedTitle=columns efi.boostedDescription=Heater}"}},
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException",
"error-class","org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException",
"root-error-class","org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException"],
"msg":"Error from server at null: cannot find model myWatersModel",
"code":400}}
日志中没有任何内容,只有相同的错误
org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException: Error from server at null: cannot find model myWatersModel
at org.apache.solr.client.solrj.impl.Http2SolrClient.processErrorsAndResponse(Http2SolrClient.java:742)
at org.apache.solr.client.solrj.impl.Http2SolrClient.request(Http2SolrClient.java:412)
at org.apache.solr.client.solrj.impl.Http2SolrClient.request(Http2SolrClient.java:761)
at org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1290)
at org.apache.solr.handler.component.HttpShardHandler.request(HttpShardHandler.java:78)
at org.apache.solr.handler.component.ShardRequestor.call(ShardRequestor.java:130)
at org.apache.solr.handler.component.ShardRequestor.call(ShardRequestor.java:41)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:180)
at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:212)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我还可以检索模型存储:
localhost:8983/solr/waterstest/schema/model-store
{
"responseHeader":{
"status":0,
"QTime":1},
"models":[{
"name":"myWatersModel",
"class":"org.apache.solr.ltr.model.LinearModel",
"store":"myWatersFeatureStore",
"features":[{
"name":"isboostedTitle",
"norm":{"class":"org.apache.solr.ltr.norm.IdentityNormalizer"}},
{
"name":"isboostedDescription",
"norm":{"class":"org.apache.solr.ltr.norm.IdentityNormalizer"}}],
"params":{"weights":{
"isboostedTitle":0.4,
"isboostedDescription":0.2}}}]}
如果特征查询工作,我也能够检索模型,那么为什么我会得到模型空错误。我知道错误处理部分不适合这里,所以有人能帮助我指出这里可能出了什么问题吗?
这就是要素文件的外观
[
{
"store" : "myWatersFeatureStore",
"name" : "isboostedTitle",
"class" : "org.apache.solr.ltr.feature.SolrFeature",
"params" : { "q" :"{!field f=title}${boostedTitle}" }
},
{
"store" : "myWatersFeatureStore",
"name" : "isboostedDescription",
"class" : "org.apache.solr.ltr.feature.SolrFeature",
"params" : { "q" :"{!field f=description}${boostedDescription}" }
}
]
和相应的模型文件
{
"store" : "myWatersFeatureStore",
"name" : "myWatersModel",
"class" : "org.apache.solr.ltr.model.LinearModel",
"features" : [
{ "name" : "isboostedTitle" },
{ "name" : "isboostedDescription" }
],
"params" : {
"weights" : {
"isboostedTitle" : 0.4,
"isboostedDescription" : 0.2
}
}
}
2条答案
按热度按时间qkf9rpyu1#
您的查询似乎是正确的。重新加载集合后是否能够解决此问题?
在将功能存储上传到
feature-store
和model
上传到model-store
之后,为了成功应用更改,重新加载集合是很重要的。删除也是如此。如果您正在研究LTR部分,this blog post可能会派上用场。
yrwegjxp2#
如注解部分所述,需要重新加载集合,因为在techproducts上的单个核心上测试相同的东西是有效的,但是在集合的情况下,需要重新加载以使更改生效