Searching with partial words in a Text field doesn't work anymore

I walked into a strange behavior when doing a search on a Text field. Searching for a partial word isn’t working anymore? For example I added the description (which is a Text field) back on sale.line into the tree view and added a new menu item to show all the sale.lines. Then do a search like description: condit and expected that all the records which have that partial in the text will show up. But it doesn’t, I have to search for the full word like airconditioner.

This showed up after migrating from 5.4 to 6.4 and looking at the SQL and documentation there is now a sort of full-text search? But is the above the right behavior? If so, that means that I have to disable full-text search on the field.

Since 6.0, Text fields are by default searched using Full Text Search for query of the form (<field>, 'ilike', '%<value>%').
This can be disabled by setting the field attribute search_full_text to False.

Normally full text search is more powerful because they have linguistic support (and not regular expression) and they can be indexed.
We use the websearch_to_tsquery syntax in Tryton which is mainly the same feature as web search engine.

In your example you must now type full word to have a match but it will match more variant of the word.

Now with Issue 11682: Left strip wildcard for search code only for full text operand - Tryton issue tracker using double %% will disable the full text search and fallback to regexp.

1 Like

Thanks for the thorough explanation!

That’s indeed how it works now. In this case the user just enters a partial and press <enter> to see the results. And they expected the same result as in 5.4. Also sometimes they search for something where they not know the complete word (was it airconditioner or conditioner?). So they type in the partial. And of course, users are lazy :shushing_face:

Looking at the issue, this wouldn’t be backported so I have to disable the full-text search for now and prepare for the double %% when the next version comes around so users can decide themselves what to use.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.