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.
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...).
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.
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!.
You must be logged in to post messages in this topic!