You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
3.6 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ====================
  5. Improved Name Search
  6. ====================
  7. Extends the name search feature to use additional, more relaxed
  8. matching methods, and to allow searching into configurable additional
  9. record fields.
  10. The name search is the lookup feature to select a related record.
  11. For example, selecting a Customer on a new Sales order.
  12. For example, typing "john brown" doesn't match "John M. Brown".
  13. The relaxed search also looks up for records containing all the words,
  14. so "John M. Brown" would be a match.
  15. It also tolerates words in a different order, so searching
  16. for "brown john" also works.
  17. .. image:: images/image0.png
  18. Additionally, an Administrator can configure other fields to also lookup into.
  19. For example, Customers could be additionally searched by City or Phone number.
  20. .. image:: images/image2.png
  21. How it works:
  22. Regular name search is performed, and the additional search logic is only
  23. triggered if not enough results are found.
  24. This way, no overhead is added on searches that would normally yield results.
  25. But if not enough results are found, then additional search methods are tried.
  26. The specific methods used are:
  27. - Try regular search on each of the additional fields
  28. - Try ordered word search on each of the search fields
  29. - Try unordered word search on each of the search fields
  30. All results found are presented in that order,
  31. hopefully presenting them in order of relevance.
  32. Installation
  33. ============
  34. No specific requirements.
  35. Configuration
  36. =============
  37. The fuzzy search is automatically enabled on all Models.
  38. Note that this only affects typing in related fields.
  39. The regular ``search()``, used in the top right search box, is not affected.
  40. Additional search fields can be configured at Settings > Technical > Database > Models,
  41. using the "Name Search Fields" field.
  42. .. image:: images/image1.png
  43. Usage
  44. =====
  45. Just type into any related field, such as Customer on a Sale Order.
  46. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  47. :alt: Try me on Runbot
  48. :target: https://runbot.odoo-community.org/runbot/149/9.0
  49. .. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
  50. .. branch is "8.0" for example
  51. Known issues / Roadmap
  52. ======================
  53. * Also use fuzzy search, such as the Levenshtein distance:
  54. https://www.postgresql.org/docs/9.5/static/fuzzystrmatch.html
  55. * The list of additional fields to search could benefit from caching, for efficiency.
  56. * This feature could also be implemented for regular ``search`` on the ``name`` field.
  57. Bug Tracker
  58. ===========
  59. Bugs are tracked on `GitHub Issues
  60. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  61. check there if your issue has already been reported. If you spotted it first,
  62. help us smashing it by providing a detailed and welcomed feedback.
  63. Credits
  64. =======
  65. Images
  66. ------
  67. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  68. Contributors
  69. ------------
  70. * Daniel Reis <https://github.com/dreispt>
  71. Maintainer
  72. ----------
  73. .. image:: https://odoo-community.org/logo.png
  74. :alt: Odoo Community Association
  75. :target: https://odoo-community.org
  76. This module is maintained by the OCA.
  77. OCA, or the Odoo Community Association, is a nonprofit organization whose
  78. mission is to support the collaborative development of Odoo features and
  79. promote its widespread use.
  80. To contribute to this module, please visit https://odoo-community.org.