Custom Search Form - Options Predicate with JSON Source Fails - AEM 6.2



Customizing the "Assets Admin Search Rail" search form.

Adding a new options predicate with a "JSON Path" source results in a filter that doesn't work.

Specifically, add an "Options Predicate" and configure the following settings:

  • Field Label - whatever
  • JSON Path - Path to json object in repo (eg. /apps/appname/rights.txt)  which as the following content:

// Rights Management


"options": [ { "value": "royalty_free", "text": "Royalty Free" }, { "value": "rights_managed", "text": "Rights Managed" }, { "value": "restricted", "text": "Restricted" } ] }


  • Property Name - /jcr:content/metadata/client/usage_rights

This will result in a filter showing up with the correct options based on the JSON.  However, selecting them has not impact on the filter and the selected options does NOT show up in the search bar above.


Alternatively, if you create a node structure for the options instead it does work as desired.

Add a new options predicate to the search form. However instead of setting the JSON Path, set the Option Path parameter to point to a node containing the appropriate options.  In this case the selected options in the filter DO impact the results and the selections do show in the search bar at the top.

I'd like to drive options predicates from JSON.  Why doesn't this work?

Answers (2)

Answers (2)