Customize omni search path to be more specific than /content/dam | Community
Skip to main content
Level 4
May 17, 2018 3:02 PM UTC
Solved

Customize omni search path to be more specific than /content/dam

We have a requirement where our main contents are under - /content/dam/<site> and we have big chunk of assets on /content/dam/archive folder.

We are trying to figure out how we can customize the default behavior of the search so that it always checks under /content/dam/<site> and fetch results. Our users do not want to "Select Search Directory" option. I am not where I can find the overlay or if I could create smart collection and make it as a default.

We tried overlayng /libs/dam/gui/coral/components/admin/customsearch/searchpredicates/pathbrowserpredicate/pathbrowserpredicate.jsp but that it is not picking up by default unless we change the "Select Search Directory" again.

Any idea or suggestions?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
vsharmAccepted solution
Level 4
May 25, 2018 3:29 AM UTC

My co-worker came up with an idea to overlay the /libs/granite/ui/components/shell/clientlibs/shell/js/omnisearch.js  and customized this javascript file for adjusting pathPredicate.value line 616. This has worked for us.

3 replies

vsharmAuthorAccepted solution
Level 4
May 25, 2018 3:29 AM UTC

My co-worker came up with an idea to overlay the /libs/granite/ui/components/shell/clientlibs/shell/js/omnisearch.js  and customized this javascript file for adjusting pathPredicate.value line 616. This has worked for us.

Translate
vsharmAuthor
Level 4
May 19, 2018 8:00 PM UTC

Thank you but the above option let us customize the "Assets Admin Search Rail". However my requirement is that in the top search panel itself, either I by default prefix the path predicate along with the "Location: Assets" or internally search only under the location - /content/dam/myrealcontents instead of /content/dam/archive.

I tried checking at - /libs/granite/ui/components/shell/omnisearch/overlay/overlay.jsp and /libs/wcm/core/content/damadmin/treeRoot, /libs/wcm/core/content/damadmin/search as well for updating the url but no luck yet .

I have used the example from - Extending Assets Search

Translate
Employee
May 17, 2018 8:43 PM UTC

Maybe you can put the default value to <site> for path predicate at (1)

(1) : http://HOST:PORT/libs/cq/core/content/tools/customsearch.html/conf/global/settings/dam/search/facets/assets/jcr:con…

Translate