s400t****@yahoo*****
s400t****@yahoo*****
2017年 7月 31日 (月) 19:39:15 JST
MLみなさん
こんにちは。
1っか月+にまたpgroonga試して見ました。
二つ単語検索のOR条件に&@~オペレーター使おうとしていますが、エラーになります。
エラー:
Undefined function: 7 ERROR: operator does not exist: text &@~ unknown LINE 3: ... WHERE target_col &@~ $1 OR ... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.'
実行したSQL:
$stmt = $pdo->prepare("SELECT 項目1、... FROM db名 WHERE target_col &@~ :keyword1 OR :keyword2");
$stmt->bindValue(':keyword1', '東京');
$stmt->bindValue(':keyword2', '大阪');
$stmt->execute();
例) target_col列の'東京'又は'大阪'をヒットさせて、一覧取得しようとしています。
https://pgroonga.github.io/reference/operators/query-v2.htmlの「Operator classes」のところ:
You need to specify one of the following operator classes to use this operator:と書いていますが、Usageのところにどうやってspecifyするのか、例がないのでこの以降どうすればよいのか、わかりません。前のバージョン(@@オペレーター)の時は検索出来ていました。
上記の例で、target_colの型は「text」で、そのフィールドのindexを作っています。
(CREATE INDEX target_col _index ON db名 USING pgroonga (target_col );)
yum updateしてpgroongaの最新ライブラリーは入れています。
CentOS log:
>Updated:
>groonga-libs.x86_64 0:7.0.5-1.el6
>Complete!
上記作業はPHP/PDOで実行していますが、PhpPgAdmin使って直接SQL文実行しても結果は同じです。
(実行した文:SELECT 項目1、... FROM db名 WHERE target_col &@~ ’東京’ OR ’大阪’;)
解決策ご存知の方、ご教授お願いします。
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download