[groonga-dev,04055] command version 3で出力されるドリルダウンのJSONについて

Back to archive index

Naoya Murakami visio****@gmail*****
2016年 6月 15日 (水) 20:23:45 JST


村上です。

コマンドバージョン3で出力されるJSONをRubyでパースしてたところ、
ラベルなしdrilldownの場合で、うまくパースできないようでした。

ラベル付きのdrilldownsならパースできるので問題はありませんが、
一応報告しておきます。

・再現例ddl、スクリプト
https://gist.github.com/naoa/2be78db216c28856996d8e1a524a4a88

・JSON
/usr/local/rbenv/versions/2.3.0/lib/ruby/2.3.0/json/common.rb:156:in
`parse': 784: unexpected token at
'{"header":{"return_code":0,"start_time":1465989170.927916,"elapsed_time":0.0003426074981689453},"body":{"n_hits":3,"columns":[{"name":"_id","type":"UInt32"},{"name":"_key","type":"ShortText"},{"name":"authors","type":"ShortText"}],"records":[[1,"Hello
Groonga",["Taro","Hanako"]],[2,"The first step for
Groonga",["Taro"]],[3,"Mastering
Groonga",["Hanako"]]],"drilldowns":"Books.authors",{"n_hits":2,"columns":[{"name":"_key","type":"ShortText"},{"name":"_nsubrecs","type":"Int32"}],"records":[["Taro",2],["Hanako",2]]}}}}
(JSON::ParserError)
'
        from
/usr/local/rbenv/versions/2.3.0/lib/ruby/2.3.0/json/common.rb:156:in `parse'


"Books.authors",{"n_hits":2....
ここにキーがないのかなぁ。
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Descargar 



groonga-dev メーリングリストの案内
Back to archive index