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

eZ Community » Forums » General » Restricting ezfind search to a single...
expandshrink

Restricting ezfind search to a single attribute

Restricting ezfind search to a single attribute

Thursday 30 May 2013 10:17:57 am - 2 replies

I'm trying to do a search in one attribute only, but having trouble getting ezfind to play properly. Can anyone help?

I need to have something like:

fetch( "ezfind", "search", hash( 'query', $search_text, 'filter', 'myclass/myattribute:*')) but the * doesn't work.

I'm expecting back all the nodes where the myattribute class contains $search_text.

This has got to be a common use case but I just can't get the right results out. Help!

Thursday 30 May 2013 10:51:36 am

i think you need go like

 <span>fetch( "ezfind", "search", hash( 'query', '', 'filter', concat( 'myclass/myattribute:', $search_text ) ))</span>

Thursday 30 May 2013 2:34:16 pm

Thanks - I'm a bit concerned that it's only going to do exact matches, but I've a preliminary problem:

I've added a custom class and attributes which I'm using here, and added the class to the .ini files. The class is coming back in results, but it's not searching in any of the new attributes. I've checked that they're defined as searchable.

Do I need to reindex the database? I'm not sure which operations make this necessary

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from