Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

This addon provides the ability to create GIN or GiST indexes of char and text fields and also to use the search operator % in search domains. Currently this module doesn’t change the backend search or anything else. It provides only the possibilty to perfrom the fuzzy search for external addons.

Table of contents

Installation

  1. The PostgreSQL extension pg_trgm should be available. In debian based distribution you have to install the postgresql-contrib module.

  2. Install the pg_trgm extension to your database or give your postgresql user the SUPERUSER right (this allows the odoo module to install the extension to the database).

Configuration

If the odoo module is installed:

  1. You can define GIN and GiST indexes for char and text via Settings -> Database Structure -> Trigram Index. The index name will automatically created for new entries.

Usage

  1. You can create an index for the name field of res.partner.

  2. In the search you can use:

    self.env['res.partner'].search([('name', '%', 'Jon Miller)])

  3. In this example the function will return positive result for John Miller or John Mill.

  4. You can tweak the number of strings to be returned by adjusting the set limit (default: 0.3). NB: Currently you have to set the limit by executing the following SQL statment:

    self.env.cr.execute("SELECT set_limit(0.2);")

  5. Another interesting feature is the use of similarity(column, 'text') function in the order parameter to order by similarity. This module just contains a basic implementation which doesn’t perform validations and has to start with this function. For example you can define the function as followed:

    similarity(%s.name, 'John Mil') DESC" % self.env['res.partner']._table

For further questions read the Documentation of the pg_trgm module.

Known issues / Roadmap

  • Modify the general search parts (e.g. in tree view or many2one fields)

  • Add better order by handling

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • bloopark systems GmbH & Co. KG

  • Eficent

  • Serpent CS

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Metadata

Release files for odoo11-addon-base-search-fuzzy 11.0.1.0.0.99.dev11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo11-addon-base-search-fuzzy 11.0.1.0.0.99.dev11
File Interpreter ABI Platform
odoo11_addon_base_search_fuzzy-11.0.1.0.0.99.dev11-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / odoo11_addon_base_search_fuzzy-11.0.1.0.0.99.dev11-py2.py3-none-any.whl

Download URL odoo11_addon_base_search_fuzzy-11.0.1.0.0.99.dev11-py2.py3-none-any.whl
Size 128.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4049105574797bff72ebb5d7fccb8c77fc395b338f263df816730e2171008747
BLAKE2b-256 checksum
How to use checksums
a886aed13ef48cc785645f411e425515ac1fadd68e31fe34c6929e46a8ca45f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page