ezFind search an array of nodes

Author Message

Fraser Hore

Thursday 25 November 2010 3:18:05 am

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

Fraser Hore

Thursday 25 November 2010 4:09:05 am

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?

Fraser Hore

Thursday 25 November 2010 9:18:13 am

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

Nicolas Pastorino

Monday 29 November 2010 1: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 !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Fraser Hore

Monday 06 December 2010 8:59:04 am

Hi Nicolas,

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

Cheers,

Fraser

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

eZ debug

Timing: Jan 18 2025 02:12:47
Script start
Timing: Jan 18 2025 02:12:47
Module start 'layout'
Timing: Jan 18 2025 02:12:47
Module start 'content'
Timing: Jan 18 2025 02:12:47
Module end 'content'
Timing: Jan 18 2025 02:12:47
Script end

Main resources:

Total runtime0.6081 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.9141152.6250
Module start 'layout' 0.00560.0030 740.539139.4531
Module start 'content' 0.00860.5983 779.9922570.0625
Module end 'content' 0.60690.0012 1,350.054716.1641
Script end 0.6081  1,366.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.5224160.0002
Check MTime0.00140.2226160.0001
Mysql Total
Database connection0.00080.134310.0008
Mysqli_queries0.537488.3628650.0083
Looping result0.00070.1119630.0000
Template Total0.576794.820.2883
Template load0.00210.353320.0011
Template processing0.574594.472420.2873
Template load and register function0.00020.030710.0002
states
state_id_array0.00090.147010.0009
state_identifier_array0.00080.124920.0004
Override
Cache load0.00190.3101410.0000
Sytem overhead
Fetch class attribute can translate value0.00120.194020.0006
Fetch class attribute name0.00110.173970.0002
XML
Image XML parsing0.00310.515920.0016
class_abstraction
Instantiating content class attribute0.00000.0034100.0000
General
dbfile0.00460.7633220.0002
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs