[Pgbigm-hackers] Adding similarity() and similarity_op(), '%' to pg_bigm

Zurück zum Archiv-Index

Fujii Masao masao****@gmail*****
2013年 10月 4日 (金) 03:44:18 JST


On Sat, Sep 28, 2013 at 6:16 PM, Beena Emerson <memis****@gmail*****> wrote:
> Please find attached the updated patch to rebase against the new HEAD and
> also implements the comments I had given before.

+PG_FUNCTION_INFO_V1(set_bigm_limit);
+Datum        set_bigm_limit(PG_FUNCTION_ARGS);
+
+PG_FUNCTION_INFO_V1(show_bigm_limit);
+Datum        show_bigm_limit(PG_FUNCTION_ARGS);

I think that it's better to treat the similarity limit as a custom GUC variable
rather than implementing special functions like the above. If we do that,
we can change and show the value of the similarity limit as follows. Thought?

    SET pg_bigm.similarity_limit TO 0.001;
    SHOW pg_bigm.similarity_limit;

+/* GIN does not support ordering operators, wait for GiST support...
+
+CREATE FUNCTION bigm_similarity_dist(text,text)
+RETURNS float4
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT IMMUTABLE;

So we should not include bigm_similarity_dist() at all?

+CREATE OPERATOR =~ (
+        LEFTARG = text,
+        RIGHTARG = text,
+        PROCEDURE = bigm_similarity_op,
+        COMMUTATOR = '=~',
+        RESTRICT = contsel,
+        JOIN = contjoinsel
+);

The character '~' usually implies regular-expression matches, so
I don't think that '=~' is good operator name. I think '=%' is better.
Thought?

Attached patch adds the similarity search feature.

Regards,

-- 
Fujii Masao
-------------- next part --------------
$B%F%-%9%H7A<00J30$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
$B%U%!%$%kL>(B: add-similarity-op-v6.patch
$B7?(B:         application/octet-stream
$B%5%$%:(B:     5209 $B%P%$%H(B
$B @ bL@(B:       $BL5$7(B
Download 



Pgbigm-hackers メーリングリストの案内
Zurück zum Archiv-Index