This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Extensions » eZ Find » Index related object "in" main object ?

Index related object "in" main object ?

Index related object "in" main object ?

Wednesday 09 April 2014 6:58:54 pm - 4 replies

Hi everyone,

it's been a while happy.gif Emoticon

I have files (mainly PDFs) used on my website. The PDF content is indexed just fine.

But I want that when someone looks for a word in the PDF, it returns the objects using the related PDF instead of the actual File (PDF) object.

I have thought about indexing the file object content into the main object but that is a bit harsh to me. Is there a better solution ?


Wednesday 09 April 2014 11:45:43 pm

There is no simple solution I am afraid.

You could implement something like the or but adapt it for relations.

You could also implement custom indexer with subattributes in solr schema.

Or you could just show the article in the search results instead of the file object happy.gif Emoticon

Maybe there is some other way but can't think of some at this moment.

Hope this helps

Friday 11 April 2014 2:21:04 pm

Been a while indeed. Still using Legacy ? Shame on you Nabil blunk.gif Emoticon

Joke aside. Hackish one: override the result line template, and fetch the parent object from there ?

Wednesday 16 April 2014 3:14:58 pm

Wow shame on me for not replying earlier ! sad.gif Emoticon

I'm working on an alternative solution actually. I will display the article and do an extra query on related objects and display those that matches the actual query.

So if I have an "shame on you for using legacy" article with a pdf "Sorry project constraints"

if the query is "constraint" my line template display would be like :


Shame on you for using legacy
Lorem ipsum ....

  • Sorry project constraints : PDF file 10kb


Tuesday 22 April 2014 6:22:12 pm

Ok I managed this part. I somehow cheated :

I make 2 queries. One for the actual search, one for the files. From the 2nd one, i build an array.

For each result of the actual search, I check related files and see if the ArrayFiles contains the file i'm checking. Works nicely


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

36 542 Users on board!

Forums menu

Proudly Developed with from