Forums / Extensions / ezFind search an array of nodes

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

eZ debug

Timing: Jan 17 2025 23:38:47
Script start
Timing: Jan 17 2025 23:38:47
Module start 'content'
Timing: Jan 17 2025 23:38:48
Module end 'content'
Timing: Jan 17 2025 23:38:48
Script end

Main resources:

Total runtime0.9827 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0147 587.7109180.8438
Module start 'content' 0.01470.8595 768.5547575.1406
Module end 'content' 0.87420.1085 1,343.6953337.3750
Script end 0.9827  1,681.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3936210.0002
Check MTime0.00130.1371210.0001
Mysql Total
Database connection0.00090.090710.0009
Mysqli_queries0.909192.50732020.0045
Looping result0.00180.18212000.0000
Template Total0.950696.720.4753
Template load0.00190.196320.0010
Template processing0.948696.529020.4743
Template load and register function0.00010.012010.0001
states
state_id_array0.00070.072910.0007
state_identifier_array0.00060.059120.0003
Override
Cache load0.00170.1704410.0000
Sytem overhead
Fetch class attribute can translate value0.00140.138530.0005
Fetch class attribute name0.00140.146770.0002
XML
Image XML parsing0.00120.118830.0004
class_abstraction
Instantiating content class attribute0.00000.0025100.0000
General
dbfile0.00190.1935330.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs