[16.0][ADD] field_vector_config - #90
Conversation
| query_str += " ORDER BY distance ASC" | ||
| if limit: | ||
| query_str += f" LIMIT {limit}" | ||
| self.env.cr.execute(query_str, params) |
There was a problem hiding this comment.
Why do not use SQL object here as well (mainly for the HAVING)?
| self.env.cr.execute(query_str, params) | |
| query = SQL( | |
| """ | |
| ... | |
| GROUP BY %s | |
| """, | |
| SQL.identifier(sql_terms[0]), | |
| ) | |
| if minim: | |
| query = SQL("%s HAVING %s < %s", query, SQL.identifier(distance), minim) | |
| query = SQL("%s ORDER BY distance ASC", query) | |
| if limit: | |
| query = SQL("%s LIMIT %s", query, int(limit)) |
There was a problem hiding this comment.
I tried to do something like this and I am unable to do it.
I will keep as it is for now.
|
|
||
| @api.model | ||
| @api.returns("self") | ||
| def search_vector_grouped( |
There was a problem hiding this comment.
this method is not documented even reading test is's not chystal clear what that does and returns ! As far I understood it returns a record set of final_field (which must be a m2o field). The recordset is sorted by the shortest distance found for a final_field related field...
I suppose this allow a use case such "finding the best product.template while searching on product.product vector" ?
There was a problem hiding this comment.
I suppose, some docstring or documentation in usage could be nice !
e91c2cd to
6e751db
Compare
6e751db to
429d3cf
Compare
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| >>>>>>> after updating |
There was a problem hiding this comment.
there is another merge conflict here 😬
Also adds fastembed.