Adding custom predicate | Community
Skip to main content
September 28, 2016

Adding custom predicate

  • September 28, 2016
  • 4 replies
  • 9403 views

In the attached picture, how can I add in my own custom predicate. That is the edition search form page btw.

My use case is I'm trying to search for a property but need a 'LIKE' constraint in there. The

OOTB property predicate currently doesn't do that.

 

Thanks you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

smacdonald2008
September 28, 2016

Because ootb one does not do that -- you can write your own using Java - this API: com.day.cq.search.PredicateGroup.

See this article as an example: 

https://helpx.adobe.com/experience-manager/using/customtags1.html

Hope this helps....  

September 29, 2016

Sorry if I wasn't clear. I want to add my own custom predicate into that list. So I can tie my custom component in with my own query.

So when I edit a search form I want to be able to see my custom predicate in that list and add that into the form.

smacdonald2008
September 29, 2016

I have never attempted to configure the search form. However - here is the docs: 

https://docs.adobe.com/docs/en/aem/6-1/administer/operations/search-forms.html

Looks like you can configure a lot there. Look at the section title: ADDING OPTIONS PREDICATES. Looks like you can overlay some nodes to meet your requirements. Have you tried that? 

September 29, 2016

I looked into that however it will still function the same as putting in an property predicate. I need to change up how the property predicate queries in the back end

and looking ways to extend this.

Adobe Employee
October 4, 2016

Is there a way I can hook this on to a the OOTB Assets Admin Search Rail?

Maybe add a component in the search rail that can link to the back end when selected?


See: https://shreshthkumar.wordpress.com/ Should help has a steps by step process of what you are trying to do. 

AnkurAhlawat-1
January 19, 2018

For adding a custom asset search predicate, you need to create 3 things:-

  • overlay and add your field -  /libs/settings/dam/search/facets/formbuilderconfig/predicatetypes/items/<fulltext>
  • Create a field property resource - dam/gui/coral/components/admin/customsearch/formbuilder/predicatefields/fulltextpredicatefield
  • Create field resource type - dam/gui/coral/components/admin/customsearch/searchpredicates/fulltextpredicate
  • Select a field resource view(How it should look) - granite/ui/components/foundation/form/textfield

Your back end logic will hook into Step 2 and 3.

venkatreddyguda
May 9, 2019

Hi,

Did you succeed in this?

Pls can you share the steps.

Thanks,

Venkat

venkatreddyguda
May 9, 2019

I created custom asset search predicate and able to see under Assets Admin Search Rail

Now i want to know how i can connect this custom asset search predicate to my predicate evaluator in the backend.

Thanks,

Venkat