eZ Community » Forums » eZ Publish 5 Platform » Add info about each node in solr index
expandshrink

Add info about each node in solr index

Add info about each node in solr index

Wednesday 02 July 2014 12:55:38 pm - 3 replies

Hello all,

I have a case study for you.

I have objects Activities (with a categories attributes) which contains objets Time Slots (with a time attriubte).

I am building a search engine to search Activities based on both categories and time. So I need to search across to kind of objects and display only Activities as search result. You get the problem ?

I am thinking about ezfind and customizing the index. I would ezfind to add info about each time slot in activities. Is it possible ? How would you do ?

 

Thank you very much

 

Wednesday 02 July 2014 2:03:42 pm

A "hackish" but effective way is to:

- create a custom datatype, add one attribute of this type to the class you want. Add empty legacy templates for edit/display it. If using eZ5, register it as null field type as well

- in ezfind, configure a custom indexation converter for that datatype

- in the converter, grab data from parent (to put in child) or from children (to put in parent) depending on needs

- make sure that when you edit the parent the children are reindexed (or viceversa) or you will get stale data in solr. A post-publish workflow event might be needed

Wednesday 02 July 2014 2:44:58 pm

Hello Gaetano,

Thank you for your answer. I wonder if there is a less hackish way to do so.

Wednesday 02 July 2014 3:26:15 pm

After a bit of search I found this promising feature : https://doc.ez.no/Extensions/eZ-Publish-extensions/eZ-Find/eZ-Find-2.7/Customization/General-Index-Time-Plugin-Mechanism

It seems I can add extra field on an objet in the solr index.

It is a great clue on how to solve my problem. However, I still have one problem. 

My activities object can have multiple time slot and I would like to add a value for earch timeslot in the new solr extra field. Is it possible to add arrays on solr index ?

Thanks

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from