ALTER OPERATOR FAMILY gist_trgm_ops USING gist ADD
OPERATOR 9 %% (text, pg_trgm_match);
It does indeed make PostgreSQL complain about undefined strategy 9. I added the following define to trgm.h:
#define ThresholdStrategyNumber9
It seems StrategyNumber is used in gtrgm_consistent and gtrgm_distance.
In gtrgm_consistent, I need change the way `nlimit` is obtained:
nlimit = (strategy == SimilarityStrategyNumber) ?
similarity_threshold : word_similarity_threshold;
I need to add a case for ThresholdStrategyNumber and extract `nlimit` from the argument of `pg_trgm_match`. I'm not sure what to do in `gtrgm_distance`.
My questions:
1a. Is it possible to make `gtrgm_consistent` accept `text` or `pg_trgm_match` as the second argument?
1b. What's the equivalent of `match.match` and `match.threshold` (where `match` is a `pg_trgm_match`) in C?
2. What to do with `gtrgm_distance`?
Thanks for help.
--
Greg Navis
I help tech companies to scale Heroku-hosted Rails apps.