From fec36181ba1dbdaa639c7135acb920f470fc81d4 Mon Sep 17 00:00:00 2001 From: OCA Git Bot Date: Wed, 13 Jun 2018 05:31:56 +0200 Subject: [PATCH] [UPD] README.rst --- base_search_fuzzy/README.rst | 131 ++++- .../static/description/index.html | 484 ++++++++++++++++++ 2 files changed, 614 insertions(+), 1 deletion(-) create mode 100644 base_search_fuzzy/static/description/index.html diff --git a/base_search_fuzzy/README.rst b/base_search_fuzzy/README.rst index d7f8f00ab..78a6b96f8 100644 --- a/base_search_fuzzy/README.rst +++ b/base_search_fuzzy/README.rst @@ -1 +1,130 @@ -This file is going to be generated by oca-gen-addon-readme. +============ +Fuzzy Search +============ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github + :target: https://github.com/OCA/server-tools/tree/11.0/base_search_fuzzy + :alt: OCA/server-tools +.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/149/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| + +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** + +.. contents:: + :local: + +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 Miller)])`` + +#. In this example the function will return positive result for `John Miller` + or `John Mill`. + +#. 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);")`` + +#. 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 smashing 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 +~~~~~~~~~~~~ + +* Christoph Giesel +* Jordi Ballester +* Serpent Consulting Services Pvt. Ltd. +* Dave Lasley +* Vicent Cubells + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. diff --git a/base_search_fuzzy/static/description/index.html b/base_search_fuzzy/static/description/index.html new file mode 100644 index 000000000..2ac9b8f98 --- /dev/null +++ b/base_search_fuzzy/static/description/index.html @@ -0,0 +1,484 @@ + + + + + + +Fuzzy Search + + + + + +