須藤です。 In <004801d4aadb$784e8ac0$68eba040$@mirror.ocn.ne.jp> "[groonga-dev,04723] Re: PGroonga における検索スコア" on Sun, 13 Jan 2019 10:01:09 +0900, <toshio_uchiy****@mirro*****> wrote: > の和でスコアリングしようとしています。教えていただいた > 構文に似せて書くと > > moovle=# WITH v AS ( SELECT id, content FROM subtitled WHERE content &@~ > ( 'algorithm', null, '{scorer_tf_at_most( $index, 100 )}', null ) > ::pgroonga_full_text_search_condition_with_scorers > ORDER BY pgroonga_score( tableoid, ctid) + vc / ( 3346800846 / 2 ) * 100 DESC > OFFSET 0 LIMIT 60) SELECT id, array_to_json( content ) as c from v; > ERROR: pgroonga: query-condition: failed to parse scorer: <Lexicon56822456_0.index>[0]: > <scorer_tf_at_most( $index>: Syntax error: <scorer_tf_at_most( > Lexicon56822456_0.index[0]||> > > とエラーになります。 '{...}'ではなくて ARRAY['scorer_tf_at_most($index, 100)'] にするとどうですか?「$index」のあとの「,」が 「scorer_tf_at_most」の引数の区切りではなくてPostgreSQLの配 列の要素の区切りと解釈されているように見えます。 -- 須藤 功平 <kou****@clear*****> 株式会社クリアコード <https://www.clear-code.com/> Groongaベースの全文検索システムを総合サポート: http://groonga.org/ja/support/ データ処理ツールの開発: https://www.clear-code.com/blog/2018/7/11.html