PG search more like this
pg_search_more_like_thisRetrieve rows that are similar to a specified seed document using PostgreSQL's more_like_this search. Optionally adjust similarity tuning with frequency, term, and word length parameters.
Instructions
Find rows similar to a seed document via pdb.more_like_this + @@@. document_id is the value of key_field for the seed row. All nine documented pdb.more_like_this tuning args (fields jsonb, min_doc_frequency, max_doc_frequency, min_term_frequency, max_query_terms, min_word_length, max_word_length, boost_factor, stop_words) are optional kwargs — when omitted the wrapper does not mention them in the SQL so upstream's defaults apply. Returns the same {id, score} hit shape as pg_search_run. Requires the pg_search extension.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | Yes | ||
| table | Yes | ||
| fields | No | ||
| schema | Yes | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| key_field | Yes | ||
| stop_words | No | ||
| document_id | Yes | ||
| boost_factor | No | ||
| max_query_terms | No | ||
| max_word_length | No | ||
| min_word_length | No | ||
| max_doc_frequency | No | ||
| min_doc_frequency | No | ||
| min_term_frequency | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |