JSON方式提交文檔時SOLR報:AtomicUpdateDocumentMerger Unknown operation for the an atomic update, operation ignored

來源:互聯網
上載者:User

標籤:期望   upd   tom   執行   encode   and   class   保留   unique   

文檔是數組轉成的json

原數組:

array(
  0 =>3,
  1 =>3,
  2 =>4,
  3 =>5,
  4 =>5,
  5 =>6
)

用array_unique去掉數組中重複的元素後,插入時報錯。

原因:

  array_unique去重之後,原數組的下標被保留了。數組為

array(
  0 =>3,
  2 =>4,
  3 =>5,
  5 =>6
)

在json_encode數組時,會把下標不連續的數組解析成json字串例如{"0":"3","2":"4","3":"5","5":6}。期望的是{["3","4","5","6"]}。造成這個報錯的原因是下標不連續。需重組一下索引,因此在array_unique之後,再執行array_values,將數組的下標重排列。這樣,在向solr的update handler 提交時就不會被認為是在做原子更新了。

JSON方式提交文檔時SOLR報:AtomicUpdateDocumentMerger Unknown operation for the an atomic update, operation ignored

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.