Forums / Extensions / eZ Find / object relations & eZ Find 2.1

object relations & eZ Find 2.1

Author Message

Benjamin Kroll

Moderated by: Nicolas Pastorino

Thursday 07 October 2010 4:26:29 pm

Hi everyone,
I have the following folder structure in my current project.

"

Category Structure
--Business & Economics [B001]
----Green Business [B002]
----Development [B003]
----General [B004]

"

The folders marked with the [B00 ...] numbers are reverse related to one of more objects of the same custom content class (product).

The products have an attribute called 'categories' which is a object relations.

When I tried to do a subcategory search using ezfind and subtree limitations I wasn't able to get any results e.g. the reverse related objects. (If anyone has a clue why that'd be great too)

Now I'm trying to get the search results by approaching it all from 'the other end' using a filtered search in the same way mentioned in the last comment here:
http://share.ez.no/forums/extensions/ez-find/content-ezfind-search-and-extended-attribute-filter#comment55276

In my case this looks something like this:

"

fetch( ezfind, search, hash( query, 'World', subtree_array, array( 93 ),
'filter', array( 'or',
array( 'product/categories:Business & Economics \[B001\]')
array( 'product/categories:Green Business \[B002\]')
array( 'product/categories:Development \[B003\]')
array( 'product/categories:General \[B004\]')
)
))

"

This search actually returns me any products located in the sub category folders,
however it also returns other products that belong to a category that shares a similar name.

For example I would get products shown that belong to the category 'Childhood Development [C021]' or 'Green Living [G033]'.

If I understand this correctly is seems like ezfind/Solr is tokenizing the names of the categories
for indexing/searching which results in false positives beind returned.

I then tried the following modification, encapsulating the whole category name in double quotes:

"

fetch( ezfind, search, hash( query, 'World', subtree_array, array( 93 ),
'filter', array( 'or',
array( 'product/categories:"Business & Economics [B001]"')
array( 'product/categories:"Green Business [B002]"')
array( 'product/categories:"Development [B003]"')
array( 'product/categories:"General [B004]"')
)
))

"

This however results in nothing being returned at all. I'm not sure why, since these would be
exact matches on the category names.

From what I can see it seems to be that the tokenizing of the category names is what I need to fix to
get this working correctly, but I have run out of ideas of where to look for configuration.

I've tried different settings for DatatypeMap[ezobjectrelationlist]=string in ezfind.ini
and re-indexing with --clean afterwards, but none of that seems to make a change in terms of my search results.

Any pointers/ideas in regards to this would be much appreciated.

I'm using eZ Publish 4.2.0 and eZ Find 2.1 btw.

Kind regards,
Ben

Paul Borgermans

Sunday 24 October 2010 4:00:08 pm

Hi,

for ez find correctly dealing with object relation list is quite a challenge conceptually if taking into account various use cases (subattribute filtering for example).

I am working on a dedicated datatype handler that should suit your use case, stay tuned (or contact me directly for more info for the ongoing work)

Best regards

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Yannick Komotir

Monday 25 October 2010 4:19:58 am

Hi,

Currently i have a similar case with eZ Find 2.2 in handling relation object list. Certainly your handler will be welcome.

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Benjamin Kroll

Tuesday 26 October 2010 11:00:10 am

Hi Paul,

thanks for the reply. It's great to hear that you're working on a handler to address this kind of use case, it is very much appreciated.

I'm sure such a handler would come in very useful for a lot of other people as well.

Thanks again,

Ben

gilles guirand

Tuesday 26 October 2010 12:17:10 pm

You could try to code your own PHP Class, using this code exemple :

http://projects.ez.no/ezfsolrdocumentfieldobjectrelation/

--
Gilles Guirand
eZ Community Board Member
http://twitter.com/gandbox
http://www.gandbox.fr