<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">須藤さんへ</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">江上です。リプライありがとうございます。</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">> なにをやりたいのかピンとこないので、再現するためのSQL一式</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">>(CREATE EXTENSION, CREATE TABLE, > > > CREATE INDEX, INSERT,</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">> SELECTなど)と現状での結果と期待する結果を教えてもらえませんか?</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">jsqueryについての説明を省いてしまって済みません。jsqueryは、以下のURLにあるように、postgresqlの拡張機能で、JSONB型を対象とした検索のユーティリティですが、演算子として@@を使っています。</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">【jsquery情報】</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><a href="https://github.com/postgrespro/jsquery" style="caret-color: rgb(0, 0, 0); background-color: rgba(255, 255, 255, 0);"><font color="#000000">https://github.com/postgrespro/jsquery</font></a></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">今回このjsqueryとpgroongaを併用しようと考えていますが、@@演算子が競合しているため、jsqueryでの検索が上手く出来ません。そこでpgroonga側で@@に反応しないように改造することが可能かについて問合せしました。</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">手前勝手な話なので改造方法を教えて欲しいというよりは、何かヒントをいただけないかというお願いになります。(可能であればの話ですが)</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">以下に、pgroonga拡張前後のjsquery検索の実行状況を示します。(以下の *.b はJSONのオブジェクトの上位をワイルドカードで指定)</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">testdb=# create extension jsquery;</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">CREATE EXTENSION</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">testdb=# SELECT '{"a":{"b":100}}'::jsonb @@ '*.b = 100';</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"> ?column? </span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">----------</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);"> t</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">(1 行)</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">testdb=# create extension pgroonga;</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">CREATE EXTENSION</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; min-height: 19.1px;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">同じjsqueryを実行</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">testdb=# SELECT '{"a":{"b":100}}'::jsonb @@ '*.b = 100';</span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">ERROR: pgroonga: jsonb: script: failed to parse script: <*.b = 100>: Syntax error: <|*|.b = 100></span></p>
<p style="margin: 0px; font-stretch: normal; line-height: normal;"><span style="background-color: rgba(255, 255, 255, 0);">---------------------------------------------</span></p></body></html>