Indexing non attributes values

Author Message

Carlos Revillo

Wednesday 08 July 2009 8:06:34 am

Hi. I know the title of my topic is not really clear, but i try to explain.

We're working in a big site, with a good nomber of content objects. At the moment we are developing the first part of the site and we already have about 9000 content objects. Each one can have comments under them.

There are many ways to categorize the content. For example, for restaurants, we have the price, the type of food they cook, the location and so on.

We have added custom datatypes and tell ezfind to index then in certain ways. We've read about the posibility of using

{fetch('ezfind', 'search', hash( )} 

to do listings and that's really nice, because in, other way, we have to built a complex extended attribute filter to solves our needs.

Finally, the questions. We can index all the values we have in datatypes, but is there any way to index related things to the restaurants that are not stored in ezcontentobjectattribute table?

i'm thinking about the posibility of usign ezfind to get the best rated restaurant, or things like that. We don't want "votes" being an attribute of any class.
Is there any way to do this without touching the php files from the ezfind extension?

Thanks a lot.

Max Keil

Wednesday 08 July 2009 3:59:49 pm

Hi again,

at the moment there is just a couple of meta and node attributes per stored for each object - defined in ezsolr.php. All of this attributes have to be attributes of eZContentObject or eZContentObjectTreeNode. There is no way to add custom meta data depending on class.
If you use special custom datatypes only in this class you can write your own indexing class "ezfSolrDocumentFieldBase" and use this to transfer extended meta data to the index.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Carlos Revillo

Thursday 09 July 2009 2:06:01 am

Thanks again, Max.

I'll give a try. On the other hand, i still doubt if this (indexing rating of objects) is really useful. i mean, its easy to think that in a single day, we will have a lot more rating actions than publishing actions. for showing results about time in real-time, we'll have to call the index with every single vote, and that's will impact in the perfomance, i think.

thinking about a cronjob, we'll have to trick the voting action to tell ez that this object "has changed" even if there's no publishing actions related to it (don't know if i'm right with this...).

best regards.

Alexandre Nion

Wednesday 05 August 2009 6:05:02 am

Hi,

I'm also not sure this will be the best way in your case, but for some reasons we also had to customize our object indexing.
The given method (creating dedicated attributes) will do the job, that's what we were usually doing for that kind of needs. But for some practical reasons (because we had several of them to write) and because these were not sensitive data to store, we recently had another approach by allowing eZ Find to handle some what we call "virtual attributes".

In the end we now have a small patch to eZ Find, working like a charm for us, and a quite simple method to write new attributes dedicated to search/facets.
As you write your indexing method (based on content class), You should be able to index any data you want within the object.

You can take a look at http://issues.ez.no/IssueView.php?Id=15222 for more information.

Carlos Revillo

Tuesday 25 August 2009 2:53:19 pm

Hi Alexandre.

I've tested your patch and works perfectly for me. at the end i'm using it for other kind of attributes, (not for voting) but it solves my needs perfectly.

thanks for sharing!.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.