[Erp5-dev] Search text

pavel lstiburek plstiburek at gmail.com
Mon Jul 2 10:23:40 CEST 2012


2012/7/2 Vincent Pelletier <vincent at nexedi.com>

> 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
>

result is <Products.ZSQLCatalog.SearchKey.FullTextKey.FullTextKey object at
0x7f5e2cc8cd50>

btw. my friend tells me that on tiolive erp5 site they have in search page
set search key Default(Keyword).
This may be solution to my problem as well. Is it possible to set this on
my erp5?

-- 
Pavel Lstiburek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20120702/b9d68e81/attachment.htm>


More information about the Erp5-dev mailing list