[Erp5-dev] Search text

Vincent Pelletier vincent at nexedi.com
Mon Jul 2 10:11:38 CEST 2012


Hi.

On Sat, 30 Jun 2012 07:06:01 +0200,
pavel lstiburek <plstiburek at gmail.com> wrote :
> first good page:
[...]
> `related_child_address_SearchableText_1_full_text`.`SearchableText`
> LIKE '%praha 7%')
[...]
> second bad page:
[...]
>   AND MATCH
> (`related_child_address_SearchableText_1_full_text`.`SearchableText`)
> AGAINST ('%praha 7%'))

The second request is what is expected in both cases when using the
SearchableText column: being fulltext-indexed, it needs to use
MATCH..AGAINST, not LIKE.

When using a fulltext field to search for a value, the "%" syntax
doesn't apply anymore. You should search for "praha 7" instead,
preserving the quotes in the searched value.

Nevertheless, the fact that they are different shows that there is a
bug in ERP5, I'll look into that. Could you give me the output of this
one-liner, so I can check how that column is configured ?

return repr(context.getPortalObject().portal_catalog.getSQLCatalog().getSearchKey('full_text.SearchableText'))

Regards,
-- 
Vincent Pelletier
ERP5 - open source ERP/CRM for flexible enterprises


More information about the Erp5-dev mailing list