[Zope] getOwner FieldIndex
Garito
garito at sistes.net
Fri Dec 3 09:33:15 EST 2004
Jonathan Hobbs wrote:
>>>>Hi again
>>>>I'm try to make searches for owner
>>>>For that I create a FieldIndex with Indexed attributes getOwner
>>>>
>>>>I reindex the catalog and it found 17 objects for Owner
>>>>
>>>>But if I make a search for Owner ZCatalog returns an empty list
>>>>
>>>>Can you help me, please?
>>>>
>>>>
>>>>
>>>>
>>>make sure you are searching on the same field 'name' that you indexed
>>>
>>>
>(ie.
>
>
>>>'getOwner'), and make sure that the field value you select is valid (ie.
>>>
>>>
>the
>
>
>>>FieldIndex must contain an entry which exactly matches the search term
>>>
>>>
>you
>
>
>>>use).
>>>
>>>HTH
>>>
>>>Jonathan
>>>
>>>
>>>
>>>
>>>
>>>
>>Hi Jonathan
>>My index is called propietario and the user is Garito
>>My search is
>>catalog({'propietario': 'Garito'})
>>
>>Is this correct?
>>
>>
>
>As long as the zcatalog you have created is named 'catalog' this looks ok to
>me. To see what is in the index create a python script with the following
>content:
>
>theIndex = context.restrictedTraverse('catalog/Indexes/propietario')
>
>for item in theIndex.items():
> print item
>
>return printed
>
>
>To quickly run the script, just click on the 'Test' tab at the top of the
>ZMI screen where you are editing the python script (after you have saved
>it!). This will give you a list of the field index values (and some other
>stuff which you can ignore).
>
>HTH
>
>Jonathan
>
>
>
>
Uau!
Thanks Jonathan. You code is very simple but it resolve a debug
problem!!!! I will use it
More information about the Zope
mailing list