Advacne search- new Date Filter Plugin issue for Compound Field

Hello All,

We are adding a new Filter fields for Coremetadata (Available Date,Refrenece date) for filtering the content based on available and refrence date in dcoument search in CMS.

I have created a new custiomezed plugin class for Date. But Result are not filerting if doing the search for CoreMetadata field but same Plugin is working fine If we do the search for Document Date field.

I have gone through the document but not found a example for Compound fields search.

Can anyone pls suggest how to get the Coremetadata fields for below code snippet.

Here are the code snappnet i was trying:
List constraints = new LinkedList();

List constraints = new LinkedList();

addDateConstraints(constraints, “myproject:CoreMetadata\myproject:date_available”, availableDateFrom, availableDateTo); – Not giving any result tried with “ftcore:date_available”)
List constraints = new LinkedList();

addDateConstraints(constraints, “myproject:CoreMetadata\myproject:date”, DateFrom, DateTo); - Working the for Document field.



public List<Constraint> getConstraints() {

    List<Constraint> constraints = new LinkedList();

addDateConstraints(constraints, “myproject:CoreMetadata\myproject:date_available”, availableDateFrom, availableDateTo);

    addDateConstraints(constraints, "myproject:CoreMetadata\myproject:date__reference", visibleReferenceFrom, visibleReferenceTo);

    return constraints;


private void addDateConstraints(final List<Constraint> constraints, final String property, final Date dateAfter,

        final Date dateBefore) {

    if (dateAfter != null) {

        final LowerBoundedDateConstraint constraint =;


        if (dateBefore != null) {



    } else if (dateBefore != null) {




Thanks in advance for your help.

The date property name (e.g. myproject:date__reference) should be the actual JCR property on the document. I’m not sure referencing a property of a subnode (compound) works here, but if it does, the reference should contain a forward slash rather than a backward one.

You can set INFO log level to class to see what XPath query was executed.


Thanks Jeroen for your reply.

I have alreday tried with (/,\ and without slash) but its search is not performed and not filtering the result in advance search.

Node Structre of coremetadata and its property: (CoreMetadata is defualt porvided metadata with CMS).

So what does the HippoJcrSearchService produce on INFO level? You can take it’s XPath and replay it on the /repository/ servlet. I would expect path “ftcore:coreMetadata/ftcore:date__reference” in there. If it is, but doesn’t work, this kind of customization only works on actual document properties and you’d have to copy the property by means of derived data function, see [1]



Yes i am able to get the query. Looking at the query I can see its taking the coremetadata @date_valid_until property. If i will search using this property in search repository i am getting the result. so I belive issue is not with compound metadata.

But my observation is that other parameters of the query like hippostd:publishable , hippo:availability etc are required for any field search for advance serach in defalut query. These parameter are not available on any compound nodes or deep node of the document hence Zero result are return.

Could you pls provide any clue how to chnage these parameter in advance serach query or what else can be done to make search query work
//element(*,hippostd:publishable)[(@hippo:paths=‘ed307dfc-5774-4ac7-9feb-79b57e058bb2’) and ((@hippo:availability = ‘preview’ or (@hippo:availability = ‘live’)) –

//element(*,hippostd:publishable)[(@hippo:paths=‘ed307dfc-5774-4ac7-9feb-79b57e058bb2’) and ((@hippo:availability = ‘preview’ or (@hippo:availability = ‘live’)) and (@ftcore:date_valid_until____day >= xs:dateTime(‘2020-06-07T00:00:00.000+05:30’)))]/… order by @hippostdpubwf:lastModificationDate descending

Documents :


The fact that query includes hippostd:publishable , hippo:availability etc. makes sense because you’re looking for documents, not for compounds.

The query has: and (@ftcore:date_valid_until____day >= ...
but you should aim to have something like and (ftcore:CoreMetadata/@ftcore:date_valid_until >= ...

Again, if that doesn’t work, use a derived data function to copy the property to document level so you can use that.


Thanks Jeroen for all your responce.
trick the query with small correction by adding star and its worked

Good to hear!
Regards, Jeroen