Solr结果分组错误。字段'vendor'的意外docvalues类型SORTED_SET(预期= SORTED) [英] Solr result grouping error .Unexpected docvalues type SORTED_SET for field 'vendor' (expected=SORTED)

查看:1985
本文介绍了Solr结果分组错误。字段'vendor'的意外docvalues类型SORTED_SET(预期= SORTED)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的solr架构

I have a solr schema like this

<fields>
   <field name="id" type="string" indexed="false" stored="true" required="true" />  
   <field name="product" type="string" indexed="true" stored="true" required="true" /> 
   <field name="vendor" type="string" indexed="true" stored="true" required="true" /> 
   <field name="language" type="string" indexed="true" stored="true" required="true" /> 
   <field name="TotalInvoices" type="float" indexed="true" stored="true" required="true"/> 
</fields>   

我正在查询架构,结果是这样的

I am querying the schema and the result is like this

product,Vendor,Invoice
abc,vendor1,49206.75999999998
abc,vendor2,35654.98000000001
abc,vendor2,94861.25999999998
abc,vendor3,990.9600000000012
abc,vendor3,990.9600000000012
abc,vendor3,990.960000000001

我想按供应商字段对结果进行分组,所以我发布了这样的查询

I want to group the result by the vendor field so I post a query like this

http://localhost:8983/solr/gettingstarted_shard2_replica2/select?q=abc
&fl=product%2Cvendor%2CTotalInvoices
&wt=json
&indent=true
&debugQuery=true
&group=true
&group.field=vendor

我在调试字段中收到错误。

I am getting an error for this in the debug field.


error :{
msg:org.apache.solr.client.solrj.SolrServerException:No liv e SolrServers可用于处理此
请求:[ http://10.192.17.110:7574/solr/ gettingstarted_shard2_replica1
http://10.192.17.110:8983/solr/gettingstarted_shard1_replica2
http://10.192.17.110:7574/solr/gettingstarted_shard1_replica1
http://10.192.17.110:8983/solr/gettingstarted_shard2_replica2]
trace:org.apache.solr.common.SolrException:org.apache.solr.client.solrj.SolrServerException:没有可用于处理此
请求的实时SolrServers
:[< a href =http://10.192.17.110:7574/solr/gettingstarted_shard2_replica1\"rel =nofollow> http://10.192.17.110:7574/solr/gettingstar ted_shard2_replica1 ,
http://10.192.17.110:8983/solr/gettingstarted_shard1_replica2
http://10.192.17.110:7574/solr/gettingstarted_shard1_replica1
http://10.192.17.110:8983/solr/gettingstarted_shard2_replica2] \ n\tat
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:342)\ n\tat
org.apache.solr.handler.RequestHandlerBase.handleRequest( RequestHandlerBase.java:143)\\\
\tat
org.apache.solr.core.SolrCore.execute(SolrCore.java:1984)\ n\tat
org.apache.solr。 servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:829)\ n\tat
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispat chFilter.java:446)\\\
\tat
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:220)\ n\tat
org.eclipse.jetty。 servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1419)\ n\tat
org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:247)\ n \\\ $
org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:210)\ n\tat
org.eclipse.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1419) \ n \\\ tt
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)\ n\tat
org.eclipse.jetty.server.handler.ScopedHandler。 handle(ScopedHandler.java:137)\ n\tat
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557) \ n\tat
org.eclipse。 jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)\ n\tat
org.eclipse.jetty.ser ver.handler.ContextHandler.doHandle(ContextHandler.java:1075)\ n\tat
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384) \ nn \ tt
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\ n\tat
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java: 1009)\ n\tat
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\ n\tat
org.eclipse.jetty.server。 handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)\ n\tat
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)\ n\tat
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\ n\tat
org.eclipse.jetty.server.Server.handle(Server.java:368) \ n \\\ $ $ $ b $ org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) \ n \\\ at
org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)\ n\tat
org.eclipse.jetty.server.AbstractHttpConnection.headerComplete( AbstractHttpConnection.java:942)\\\
\tat
org.eclipse.jetty.server.AbstractHttpConnection $ RequestHandler.headerComplete(AbstractHttpConnection.java:1004)\ n\tat
org.eclipse。 jetty.http.HttpParser.parseNext(HttpParser.java:640) \ n\tat
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) \ nn \ tat
org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)\ n\tat
org.eclipse.jetty.server.bio.SocketConnector $ ConnectorEndPoint.run(SocketConnector.java: 264)\ n\tat
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\ n\tat
org.eclipse.jetty.util。 thread.QueuedThreadPool $ 3.run(QueuedThreadPool.java:543)\\\
\ta t
java.lang.Thread.run(Thread.java:745)\ nCaused by:
org.apache.solr.client.solrj.SolrServerException:没有可用的SolrServers
这个
请求:[ http://10.192.17.110:7574/solr/gettingstarted_shard2_replica1
http://10.192.17.110:8983/solr/gettingstarted_shard1_replica2
http://10.192.17.110:7574/solr/gettingstarted_shard1_replica1
< a href =http://10.192.17.110:8983/solr/gettingstarted_shard2_replica2] =nofollow> http://10.192.17.110:8983/solr/gettingstarted_shard2_replica2] \ n\tat
org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:349)\ n\tat
org.apache.solr.handler.component.HttpSha rdHandlerFactory.makeLoadBalancedRequest(HttpShardHandlerFactory.java:226)\ n\tat
org.apache.solr.handler.component.HttpShardHandler $ 1.call(HttpShardHandler.java:224) \ nn\tat
org.apache.solr.handler.component.HttpShardHandler $ 1.call(HttpShardHandler.java:184)\ n\tat
java.util.concurrent.FutureTask.run(FutureTask.java:262) \ n\tat
java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:471)\ n\tat
java.util.concurrent.FutureTask.run(FutureTask.java: 262)\ n\tat
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) \ n\tat
java.util.concurrent.ThreadPoolExecutor $ Worker.run( ThreadPoolExecutor.java:615)\\\
\t ...
1 more\\\
Caused by:
org.apache.solr.client.solrj.impl.HttpSolrClient $ RemoteSolrException:
来自
服务器的错误 h ttp://10.192.17.110:8983 / solr / gettingstarted_shard1_replica2
意外docvalues为字段'vendor'
(预期= SORTED)输入SORTED_SET。使用UninvertingReader或索引与
docvalues.\\\
\tat
org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:556) \ n \ $
org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:233)\ n\tat
org.apache.solr.client.solrj.impl.HttpSolrClient.request (HttpSolrClient.java:225)\\\
\tat
org.apache.solr.client.solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:370) \ n\tat
org .apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:338)\ n\t ...
9 more \ n,
code:500 }

"error":{ "msg":"org.apache.solr.client.solrj.SolrServerException: No live SolrServers available to handle this request:[http://10.192.17.110:7574/solr/gettingstarted_shard2_replica1, http://10.192.17.110:8983/solr/gettingstarted_shard1_replica2, http://10.192.17.110:7574/solr/gettingstarted_shard1_replica1, http://10.192.17.110:8983/solr/gettingstarted_shard2_replica2]", "trace":"org.apache.solr.common.SolrException: org.apache.solr.client.solrj.SolrServerException: No live SolrServers available to handle this request:[http://10.192.17.110:7574/solr/gettingstarted_shard2_replica1, http://10.192.17.110:8983/solr/gettingstarted_shard1_replica2, http://10.192.17.110:7574/solr/gettingstarted_shard1_replica1, http://10.192.17.110:8983/solr/gettingstarted_shard2_replica2]\n\tat org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:342)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:1984)\n\tat org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:829)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:446)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:220)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)\n\tat org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:247)\n\tat org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:210)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:368)\n\tat org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)\n\tat org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)\n\tat org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)\n\tat org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)\n\tat org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)\n\tat org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)\n\tat org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)\n\tat org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\n\tat java.lang.Thread.run(Thread.java:745)\nCaused by: org.apache.solr.client.solrj.SolrServerException: No live SolrServers available to handle this request:[http://10.192.17.110:7574/solr/gettingstarted_shard2_replica1, http://10.192.17.110:8983/solr/gettingstarted_shard1_replica2, http://10.192.17.110:7574/solr/gettingstarted_shard1_replica1, http://10.192.17.110:8983/solr/gettingstarted_shard2_replica2]\n\tat org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:349)\n\tat org.apache.solr.handler.component.HttpShardHandlerFactory.makeLoadBalancedRequest(HttpShardHandlerFactory.java:226)\n\tat org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:224)\n\tat org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:184)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:262)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:262)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n\t... 1 more\nCaused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://10.192.17.110:8983/solr/gettingstarted_shard1_replica2: unexpected docvalues type SORTED_SET for field 'vendor' (expected=SORTED). Use UninvertingReader or index with docvalues.\n\tat org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:556)\n\tat org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:233)\n\tat org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:225)\n\tat org.apache.solr.client.solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:370)\n\tat org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:338)\n\t... 9 more\n", "code":500}}

请帮帮我。

推荐答案

我在尝试对字段'ViewCount'进行排序时遇到了同样的问题:

I hit the same problem when trying to sort on field 'ViewCount':

 unexpected docvalues type SORTED_SET for field 'ViewCount' (expected=SORTED) ...

错误理解ing:
来自此处

Any Trie* numeric fields, date fields and EnumField.`enter code here`
If the field is single-valued (i.e., multi-valued is false), Lucene will use the NUMERIC type.
If the field is multi-valued, Lucene will use the SORTED_SET type. 

看起来错误是由ViewCount字段的多值属性引起的。此外,作为 doc ,该字段的索引属性必须为true。

Looks like the error is caused by the "multi-valued" property of the field "ViewCount". Further more, as the doc, the field's "indexed" property has to be true.

我的核心名称是bigdata。

I have a core name "bigdata".

我的解决方案:


  • 删除bigdata中的所有文件

  • delete all documents in "bigdata"

curl http:// localhost:8983 / solr / bigdata / update --data''-H'内容型:文本/ XML; charset = utf-8'
curl http:// localhost:8983 / solr / bigdata / update --data'' - H'内容类型:text / xml; charset = utf-8'

curl http://localhost:8983/solr/bigdata/update --data ':' -H 'Content-type:text/xml; charset=utf-8' curl http://localhost:8983/solr/bigdata/update --data '' -H 'Content-type:text/xml; charset=utf-8'

将字段更改为long(或任何不是多值的类型)并编入索引

change the field to long(or any type that's not multi-valued) and indexed

curl -X POST -H'Content-type:application / json'-- data-binary'{
replace-field:{
name:ViewCount ,
type:long,
multiValued:false,
indexed:true,
存储:true
}
}' http:// localhost:8983 / solr / bigdata / schema

curl -X POST -H 'Content-type:application/json' --data-binary '{ "replace-field":{ "name":"ViewCount", "type":"long", "multiValued":false, "indexed":true, "stored":true } }' http://localhost:8983/solr/bigdata/schema

重新加载bigdata

reload "bigdata"

http:// localhost:8983 / solr / admin / cores?action = RELOAD& core = bigdata

再次将您的数据导入bigdata

import your data to "bigdata" again

重新加载bigdata

reload "bigdata"

http:// localhost:8983 / solr / admin /核心s?action = RELOAD& core = bigdata

问题1:删除所有文档可能会让某人感到痛苦。我尝试了上面的步骤而没有删除并重新导入所有文档,但没有工作。看起来就像Crypt经历的那样。

Issue1: delete all docs maybe painful to someone. I tried the steps above without delete and re-import all docs, but not worked. Looks like that's what Crypt experienced.

问题2:如果你使用无缝模式。我的意思是你不手动编辑模式,你需要在重新导入数据之前在solrconfig.xml中设置模式不可变。相关文档是此处

Issue2: if you use seamless mode. I mean you don't manually edit the schema, you need to set the schema immutable in "solrconfig.xml" before re-import your data. The relevant doc is here

这篇关于Solr结果分组错误。字段'vendor'的意外docvalues类型SORTED_SET(预期= SORTED)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆