Help with "Search"

After the migration from 5.2 to 6.0 we have observed that searches act differently. I give an example:

Product_product with Description *** E3407 *****

If I do a search like “Description:E3407” it works as expected. On the other hand, if we search for “Description:E340” no result appears

I have tried with other fields as code, name (they are not the same field type) but in these cases it works correctly.

Any idea to get better results on search?

image

image

Maybe you have an older version before Issue 10710: Searching by similarity is astonishing for unordered search - Tryton issue tracker. In this case if the database has SIMILARITY function, the search will use a threshold of 0.3.

We had SIMILARITY disabled in DB, We have already enabled it and checked with has_similarity(). Even so, the result in the searches is the same as the I showed in the previous post. I find the notable difference when in the search inside the clauses (doing debugging) I change the ilike for a like (I comment it in case it can help to find out where the problem lies) because the result looks like the search result that received in version 5.2.
I tried to inside context modify the search_similarity greater and lower than 0.3 with same result

If the field is a Text field than it is a full text search that it done on it. Full text search does not work well on “codified” symbol because it is searching by token.

Yes is a text field

description = fields.Text(“Description”, translate=True)

What u recommend to do? I can change the clause ilike by like or maybe its better change the field from description? What u think?

Thanks in advance for your help!

If the content of the field is a code, better to use identifiers to store them.

The description is not always composed by codes but it is on many occasions. By this reasson i’m interested to improve this.

Thanks again @pokoli :kissing_closed_eyes: @ced