Fuzzy Search
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 possibility to perform the fuzzy search for external addons.
Table of contents
Installation
- The PostgreSQL extension pg_trgm should be available. In debian based distribution you have to install the postgresql-contrib module.
- 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:
- 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
You can create an index for the name field of res.partner.
In the search you can use:
self.env['res.partner'].search([('name', '%', 'Jon Smit')])
In this example the function will return positive result for John Smith or John Smit.
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 statement:
self.env.cr.execute("SELECT set_limit(0.2);")
For further questions read the Documentation of the pg_trgm module.
Usage with demo data
There are some demo data that allow you to test functionally this module if you are in a demo database. The steps are the following:
- Go to Contacts and type the text Jon Smith or Smith John in the search box and select Search Display Name for: …
- You will see two contacts, and they are the ones with display names John Smith and John Smizz.
Known issues / Roadmap
- Modify the general search parts (e.g. in tree view or many2one fields)
- Add better order by handling
- This module will not be necessary from version 16 ([IMP] Better handling of indexes #83015)
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
- ForgeFlow
- Serpent CS
Contributors
- Christoph Giesel <https://github.com/christophlsa>
- Jordi Ballester <jordi.ballester@forgeflow.com>
- Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
- Dave Lasley <dave@laslabs.com>
- Tecnativa:
- Vicent Cubells
- Ernesto Tejeda
- teodoralexandru@nexterp.ro 2020 NextERP SRL.
- Daniel Reis <dreis@opensourceintegrators.com>
- Nikul Chaudhary <nchaudhary@opensourceintegrators.com>
- Nguyen Minh Chien <chien@trobz.com>
Maintainers
This module is maintained by the OCA.

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.
Python dependencies
Package | Version | Secured | ||
---|---|---|---|---|
psycopg2_binary | 2.8.6 |
Available languages
Language | % translated | ||
---|---|---|---|
Spanish (AR) / Español (AR) |
100%
|
||
Italian / Italiano |
100%
|
||
Portuguese (BR) / Português (BR) |
100%
|
||
Chinese (Simplified) / 简体中文 |
88%
|
||
Portuguese / Português |
83%
|
||
Slovenian / slovenščina |
83%
|
||
French / Français |
83%
|
||
German / Deutsch |
83%
|
||
Croatian / hrvatski jezik |
44%
|
||
Dutch / Nederlands |
44%
|
||
Arabic / الْعَرَبيّة |
44%
|
||
Finnish / Suomi |
44%
|
||
Romanian / română |
44%
|
||
Dutch / Nederlands |
44%
|
||
Indonesian / Bahasa Indonesia |
38%
|
||
Turkish / Türkçe |
38%
|
||
Spanish / Español |
38%
|
||
Thai / ภาษาไทย |
38%
|
||
Spanish (EC) / Español (EC) |
38%
|
||
Mongolian / монгол |
38%
|
||
Portuguese / Português |
38%
|
||
Spanish / Español |
38%
|
||
Swedish / Svenska |
38%
|
||
Macedonian / македонски јазик |
38%
|
||
Hebrew / עִבְרִי |
38%
|
||
English (UK) |
38%
|
||
Estonian / Eesti keel |
38%
|
||
Spanish (CO) / Español (CO) |
38%
|
||
Chinese (Traditional) / 繁體中文 |
38%
|
||
Croatian / hrvatski jezik |
38%
|
||
Norwegian Bokmål / Norsk bokmål |
38%
|
||
French (CH) / Français (CH) |
38%
|
||
Bosnian / bosanski jezik |
38%
|
||
Turkish / Türkçe |
38%
|
||
Spanish (VE) / Español (VE) |
38%
|
||
Spanish (PE) / Español (PE) |
38%
|
||
Dutch (BE) / Nederlands (BE) |
38%
|
||
Vietnamese / Tiếng Việt |
38%
|
||
Bulgarian / български език |
38%
|
||
Polish / Język polski |
38%
|
||
Spanish (MX) / Español (MX) |
38%
|
||
Japanese / 日本語 |
38%
|
||
Spanish (CL) / Español (CL) |
38%
|
||
Ukrainian / українська |
38%
|
||
Slovak / Slovenský jazyk |
38%
|
||
Persian / فارس |
38%
|
||
Spanish (DO) / Español (DO) |
38%
|
||
Serbian (Latin) / srpski |
38%
|
||
Hungarian / Magyar |
38%
|
||
Russian / русский язык |
33%
|
||
French (CA) / Français (CA) |
33%
|
||
Greek / Ελληνικά |
27%
|
||
Vietnamese / Tiếng Việt |
27%
|
||
Lithuanian / Lietuvių kalba |
27%
|
||
Lithuanian / Lietuvių kalba |
27%
|
||
Spanish (PY) / Español (PY) |
27%
|
||
Spanish (CR) / Español (CR) |
27%
|
||
Latvian / latviešu valoda |
27%
|
||
Galician / Galego |
5%
|
||
Galician / Galego |
5%
|