eZ Community » Forums » Extensions » ezFind search an array of nodes
expandshrink

ezFind search an array of nodes

ezFind search an array of nodes

Thursday 25 November 2010 12:18:05 pm - 4 replies

Is it possible to use ezFind to search within an array of nodes?

My scenario is that I have project class objects that have lessons class objects as children. I want to seach the lessons objects but be able to use the attributes of the project class as facets for the drill down.

My approach is to have one ezfind search which searches the lessons class objects using the search text. I then use lessons objects returned in the search results to create a unique list of the parent ids (the ids of the containing project objects).

I then have a second ezfind search which has search text = '' ( so it will find all ) and I want it to return all the project objects with ids included in the array of parent ids extracted from from the search of lesson objects. This way the drill down facets will find a subset of the project objects listed in the parent ids array. Unfortunately subtree_array returns only children so that didn't work.

Any ideas?

Thanks!

Fraser

Thursday 25 November 2010 1:09:05 pm

Update: I discovered by testing other classes that the subtree_array and the filter path:node_id both return the root node given in the results. So the problem seems to be that my project class objects aren't being properly indexed for some reason.

If I try to do a basic search for:

{set $search=fetch( ezfind,search,
hash( 'query', '',
'filter', 'path:886'
))}

Node 886 isn't returned with the results. Only its children are returned.

Any idea why this may be happening?

Thursday 25 November 2010 6:18:13 pm

UPDATE 2 - Problem Solved.

I discovered that the problem related to the presence of an object relations attribute in the project class. For some reason when objects had an item selected in the object relations attribute, they weren't indexed properly. I'm using http://projects.ez.no/ezfsolrdocumentfieldobjectrelation/ so perhaps that has something to do with it. I solved the problem by editing all the project objects to de-select the object relation, submit, re-edit, re-select and re-submit. After this the objects were all found and returned by the ezfind search.

Cheers,

Fraser

Monday 29 November 2010 10:48:39 am

Hi Fraser !

Thanks for keeping up posted along the way, and good to hear you found a solution. I was to recommend to surface the issues you encountered directly on the project's page, but could notice you already did so on other subjects.

How about requesting membership to the project and bringing updates, based on your field experience ?

Cheers !

Monday 06 December 2010 5:59:04 pm

Hi Nicolas,

Good point. I'll try to use the project-specific forums where possible.

Cheers,

Fraser

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from