XPATH query result exclude specific document type has issue

Hi Team,

Executing an XPATH query, on a certain scenario getting inconsistent results. Our Bloomreach release version is 14.7.17

Excluding an specific document type from XPATH search with below query, returning excluded document type result in result.
Our expectation was, results documents exclude type of brxp:AlertMessage and brxp:Disclosure

//element(, hippo:handle)[.//hippo:availability=‘live’ and .//hippo:paths=‘fc15b5b8-1ae6-4276-975b-900a556abc89’ and (.//jcr:primaryType!=‘brxp:Disclosure’ and .//jcr:primaryType!=‘brxp:AlertMessage’ ) and (jcr:contains(., ‘bottom*’) or jcr:contains(., ‘bottom’) or jcr:contains(.//brxp:headline, 'bottom’) or jcr:contains(.//brxp:title, 'bottom’) ) ] order by @jcr:score descending*

Failure Scenario:

If any of the AlertMessage or Disclosure type documents, has publish request/rejected publish request, handle will have an hippo:request child node. In that case, that document will returned in query list. After identified the Root Cause tried to adjust XPATH by excluding hippostdpubwf:request primaryType as mentioned below. But this also giving same result.

//element(, hippo:handle)[.//hippo:availability=‘live’ and .//hippo:paths=‘fc15b5b8-1ae6-4276-975b-900a556abc89’ and (.//jcr:primaryType!=‘brxp:Disclosure’ and .//jcr:primaryType!=‘brxp:AlertMessage’ and .//jcr:primaryType!=‘hippostdpubwf:request’ ) and (jcr:contains(., 'bottom’) or jcr:contains(., ‘bottom’) or jcr:contains(.//brxp:headline, 'bottom’) or jcr:contains(.//brxp:title, 'bottom’) ) ] order by @jcr:score descending*

Thanks,
Gnana moorthi

I think the hippo:request nodes have a primary type of hipposched:workflowjob. Could you try that?

hippo:request child nodes can be either of type hippostdpubwf:request ((de)publication & rejected requests) or hipposched:workflowjob (schedule (de)publish requests) so you would have to check for both.

@Lef_Karamoulas and @jasper.floor this was solved via a ticket…solution was to use:

not(./*/@jcr:primaryType='paths:newsdocument') 

instead of:

./*/jcr:primaryType!='paths:newsdocument'

I guess != should work too…but not without “@” …

@machak
Yes it worked with not(./*/@jcr:primaryType=‘paths:newsdocument’) option.

Thanks for your suggestions.