Hbase 二级索引 Solr int字段排序问题 can not sort on multivalued field
生活随笔
收集整理的這篇文章主要介紹了
Hbase 二级索引 Solr int字段排序问题 can not sort on multivalued field
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Hbase Solr 同步二級索引后,進行int字段排序時報錯
報錯如下
{"responseHeader":{"zkConnected":true,"status":400,"QTime":75,"params":{"q":"*:*","sort":"hbase_indexer_fn_read_num desc","_":"1576474856934"}},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.common.SolrException"],"msg":"can not sort on multivalued field: hbase_indexer_fn_read_num","code":400}}提示不能是multivalued屬性
多值在solr中顯示如下,帶中括號
false 情況下應為下圖,不帶中括號
修改?schema.xml 文件,?multivalued = "false"
<field name="hbase_indexer_fn_read_num" type="string" indexed="true" multiValued="false" stored="true"/>更新solr配置
更新配置文件; solrctl instancedir --update vt_index /home/jast/opt/hbase-indexer/vt_weibo_index 更新collection; solrctl collection --reload vt_index再次寫入數據,排序查詢后還是提示異常,
原因:新版的solr,將默認的字段docValues="true"
最后加入?docValues="false"
<field name="hbase_indexer_fn_read_num" type="string" indexed="true" docValues="false" multiValued="false" stored="true"/>再次查詢,返回正常
docValues作用
docValues: 如果這個字段應該有文檔值(doc values),設置為true。文檔值在門
面搜索,分組,排序和函數查詢中會非常有用。雖然不是必須的,而且會導致生成
索引變大變慢,但這樣設置會使索引加載更快,更加NRT友好,更高的內存使用效率。
然而也有一些使用限制:目前僅支持StrField, UUIDField和所有 Trie*Fields,
并且依賴字段類型, 可能要求字段為單值(single-valued)的,必須的或者有默認值。
?參考鏈接:https://www.jianshu.com/p/2f4a2f77eaad
總結
以上是生活随笔為你收集整理的Hbase 二级索引 Solr int字段排序问题 can not sort on multivalued field的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Hbase1.2数据导入2.0
- 下一篇: dll加载问题的解决方法