2011/2/7 Maurits van Rees <m.van.r...@zestsoftware.nl>

> Hi Gil,
>
> Op 07-02-11 11:13, Gil Forcada schreef:
>
>  Hi,
>>
>> I have a site which has some custom Archtypes documents and I recently
>> find out that when doing a search on the Plone site it doesn't return
>> those documents when the search string is inside the documents' main body.
>>
>> The documents' field is called "body" whereas on the default Archtypes
>> is called "text" so the field wasn't indexed.
>>
>> I cataloged the body filed but still the searches doesn't return the
>> documents.
>>
>> Which led my to the SearchableText index, which, correct me if I'm
>> wrong, is the one used when searching.
>>
>> I created TTW an index which seemed to work fine, but then when I
>> exported it to Generic Setup's xml it didn't work, see it below:
>>
>> <index name="SearchableText" meta_type="ZCTextIndex">
>> <indexed_attr value="SearchableText,getBody" />
>> <extra name="index_type" value="Okapi BM25 Rank" />
>> <extra name="lexicon_id" value="plone_lexicon" />
>> </index>
>>
>> Any idea why does this happen? Is this the correct approach on getting
>> your custom fields be used when doing a search?
>>
>
> No, don't do it like this.
>
> Instead, look at Products/ATContentTypes/content/document.py: in its text
> field definition it has searchable=True.  Add that to the field definition
> in your custom schema and it should work: undo your changes to the catalog
> and reindex the SearchableText index and you should be able to find your
> content now.
>
> See also the definition of SearchableText in
> Products/Archetypes/BaseObject.py
>


Thanks a lot!

I tried searching on plone.org without success, and your tips worked like a
charm.

Cheers,


> Cheers,
>
> --
> Maurits van Rees
> Web App Programmer at Zest Software: http://zestsoftware.nl
> Personal website: http://maurits.vanrees.org/
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers@lists.plone.org
> https://lists.plone.org/mailman/listinfo/product-developers
>



-- 

*Gil Forcada**
*C/Llacuna, 166 2n.2a (Edifici Llacuna)
telf: 93.188.88.12 - 619.65.34.92
fax: 93.320.93.97
(08018) BARCELONA
g...@usecm.com
www.usecm.com
_______________________________________________
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers

Reply via email to