日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Hbase 二级索引 Solr int字段排序问题 can not sort on multivalued field

發布時間:2024/8/23 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。