[14.0] [ADD] full_text_search#3647
Draft
paradoxxxzero wants to merge 1 commit into
Draft
Conversation
72d93e8 to
b7fc13a
Compare
b7fc13a to
0adc373
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This module provides a simple way to use full-text search functionality in Odoo models.
It is fully based on PostgreSQL full-text search, and adds a new
Searchablefield that represents the TSVector column in the database that will store the weighted full-text vector. It also adds thefull_textmatching operator :@@to odoo domains.To add this functionality to a model, simply add a
Searchablefield to the model with the fields you want to search on weighted by their importance:A,B,C,DwithAbeing the most important.And add the
full_textfield to the model's search view (first position is recommended):You can also use the
full_textoperator in your own code to search for records:The search query uses the PostgreSQL websearch syntax with additional prefix matching:
The results will be sorted by relevance if no other sort order is specified.