About the coreQueryPageProvider and Predicate /fixedPart

Hello,

I have to query several sub-workspace where there are several types of documents. Each type of theses documents contains one same metadata among others.

So, I can't use

I try to use the

For example, I can't use that because I want a OR and not a AND :

<predicate parameter="MonTypeA:sitebat" operator="STARTSWITH">
       <field schema="my_advanced_search" name="site" />
</predicate>
 <predicate parameter="MonTypeB:sitebat" operator="STARTSWITH">
       <field schema="my_advanced_search" name="site" />
 </predicate>

And this doesn't ok :

       <fixedPart>
        ecm:isCheckedInVersion = 0 AND
        ecm:currentLifeCycleState != 'deleted' AND
        ( ecm:primaryType = 'MonTypeA' OR
        ecm:primaryType = 'MonTypeB' ) AND
        ( MonTypeA:sitebat STARTSWITH ? OR
          MonTypeB:sitebat STARTSWITH ?)             `) 
      </fixedPart>      
    </whereClause>
      <parameter>my_advanced_search:site</parameter>
      <parameter>my_advanced_search:site</parameter>

The problem comes from the syntax of element

Thanks for any help.

0 votes

1 answers

1334 views

ANSWER



Hello,

I found the solution : searchDocument, obviously !

<fixedPart>
    ecm:isCheckedInVersion = 0 AND
    ecm:currentLifeCycleState != 'deleted' AND
    ( ecm:primaryType = 'MonTypeA' OR
    ecm:primaryType = 'MonTypeB' ) AND
    ( MonTypeA:sitebat STARTSWITH ? OR
      MonTypeB:sitebat STARTSWITH ?) ) 
  </fixedPart>      
</whereClause>
  <parameter>#{searchDocument.my_advanced_search.site}</parameter>
  <parameter>#{searchDocument.my_advanced_search.site}</parameter>
1 votes