<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Search results different Document types in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/search-results-different-document-types/m-p/320496#M7497</link>
    <description>&lt;P&gt;Hi Dalal, the 3 document types must have those fields in common in the same schema and when you execute this query, it SUMS the three fields like an "AND" instead an "OR". I did something like this in my project. This is the coreQuery:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;			&amp;lt;whereClause docType="liasse_search"&amp;gt;
				&amp;lt;fixedPart&amp;gt;
					ecm:primaryType IN ('b1',
					'facture',
					'bc')
					AND ecm:mixinType !=
					'HiddenInNavigation'
					AND NOT (ecm:mixinType = 'Collection' AND
					ecm:name = 'Locally
					Edited')
					AND ecm:isCheckedInVersion = 0
					AND
					ecm:currentLifeCycleState != 'deleted'
					AND SORTED_COLUMN IS NOT
					NULL
				&amp;lt;/fixedPart&amp;gt;
				
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You also have to create a schema with with num_bc (num_schema in the following code), add this schema to your three types, and create in this schema the field "num_bc"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	&amp;lt;doctype  name="facture" extends="Document"&amp;gt;
	    &amp;lt;schema name="num_schema" /&amp;gt;
		&amp;lt;schema name="facture_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;

	&amp;lt;doctype  name="b1" extends="Document"&amp;gt;
        &amp;lt;schema name="num_schema" /&amp;gt;
		&amp;lt;schema name="b1_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;

	&amp;lt;doctype  name="b2" extends="Document"&amp;gt;
	    &amp;lt;schema name="num_schema" /&amp;gt;
		&amp;lt;schema name="b2_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You also can do it with hierachy with a supertype&lt;/P&gt;
&lt;P&gt;For example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	&amp;lt;doctype name="myCustomSuperType" extends="Document"&amp;gt;
		&amp;lt;schema name="myCustomSuperType_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;

	&amp;lt;doctype  name="facture" extends="myCustomSuperType"&amp;gt;
		&amp;lt;schema name="facture_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;

	&amp;lt;doctype  name="b1" extends="myCustomSuperType"&amp;gt;
		&amp;lt;schema name="b1_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope this helps you.&lt;/P&gt;
&lt;P&gt;EDIT: This solution should also work for you without creating a new schema (using parameters instead of predicates)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fixedPart&amp;gt;
    ecm:isCheckedInVersion = 0 AND
    ecm:currentLifeCycleState != 'deleted' AND
    ( ecm:primaryType = 'bc' OR ecm:primaryType = 'bl' OR ecm:primaryType = 'facture'  ) AND
    ( bc:num_bc = ? OR
      b1:num_bc = ? OR fctr:num_bc = ?) ) 
  &amp;lt;/fixedPart&amp;gt;      
&amp;lt;/whereClause&amp;gt;
  &amp;lt;parameter&amp;gt;#{searchDocument.liasse_search.num_bc}&amp;lt;/parameter&amp;gt;
  &amp;lt;parameter&amp;gt;#{searchDocument.liasse_search.num_bc}&amp;lt;/parameter&amp;gt;
  &amp;lt;parameter&amp;gt;#{searchDocument.liasse_search.num_bc}&amp;lt;/parameter&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://answers.nuxeo.com/general/q/d0f8a109a7fc43689bc08e1fbc129053/About-the-coreQueryPageProvider-and-Predicate-fixedPart" target="test_blank"&gt;https://answers.nuxeo.com/general/q/d0f8a109a7fc43689bc08e1fbc129053/About-the-coreQueryPageProvider-and-Predicate-fixedPart&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2015 15:57:35 GMT</pubDate>
    <dc:creator>JVent_</dc:creator>
    <dc:date>2015-07-23T15:57:35Z</dc:date>
    <item>
      <title>Search results different Document types</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/search-results-different-document-types/m-p/320495#M7496</link>
      <description>&lt;P&gt;I have created the following document types: Bc,Bl,facture; they are all linked by the field num_bc. I created a local search by num_bc, my issue is that the search can results only one of the three document types but not all of them.&lt;/P&gt;
&lt;P&gt;here's what I've tried:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;coreQueryPageProvider&amp;gt;
        &amp;lt;property name="coreSession"&amp;gt;#{documentManager}&amp;lt;/property&amp;gt;
        &amp;lt;property name="maxResults"&amp;gt;DEFAULT_NAVIGATION_RESULTS&amp;lt;/property&amp;gt;
        &amp;lt;whereClause docType="liasse_search"&amp;gt;
          &amp;lt;predicate parameter="bc:num_bc" operator="="&amp;gt;
            &amp;lt;field schema="liasse_search" name="num_bc" /&amp;gt;
          &amp;lt;/predicate&amp;gt;
          &amp;lt;predicate parameter="bl:num_bc" operator="="&amp;gt;
            &amp;lt;field schema="liasse_search" name="num_bc" /&amp;gt;
          &amp;lt;/predicate&amp;gt;
          &amp;lt;predicate parameter="fctr:num_bc" operator="="&amp;gt;
            &amp;lt;field schema="liasse_search" name="num_bc" /&amp;gt;
          &amp;lt;/predicate&amp;gt;
          &amp;lt;fixedPart&amp;gt;
                ecm:isCheckedInVersion = 0 AND
        				ecm:mixinType != 'HiddenInNavigation' AND 
        				ecm:currentLifeCycleState != 'deleted' AND
        				ecm:primaryType = 'bc' OR ecm:primaryType = 'bl' OR ecm:primaryType = 'facture'  
          &amp;lt;/fixedPart&amp;gt;
      &amp;lt;sort column="dc:title" ascending="true" /&amp;gt;
        &amp;lt;pageSize&amp;gt;20&amp;lt;/pageSize&amp;gt;     
        &amp;lt;/whereClause&amp;gt;
      &amp;lt;/coreQueryPageProvider&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jun 2015 11:47:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/search-results-different-document-types/m-p/320495#M7496</guid>
      <dc:creator>Dalal_</dc:creator>
      <dc:date>2015-06-17T11:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Search results different Document types</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/search-results-different-document-types/m-p/320496#M7497</link>
      <description>&lt;P&gt;Hi Dalal, the 3 document types must have those fields in common in the same schema and when you execute this query, it SUMS the three fields like an "AND" instead an "OR". I did something like this in my project. This is the coreQuery:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;			&amp;lt;whereClause docType="liasse_search"&amp;gt;
				&amp;lt;fixedPart&amp;gt;
					ecm:primaryType IN ('b1',
					'facture',
					'bc')
					AND ecm:mixinType !=
					'HiddenInNavigation'
					AND NOT (ecm:mixinType = 'Collection' AND
					ecm:name = 'Locally
					Edited')
					AND ecm:isCheckedInVersion = 0
					AND
					ecm:currentLifeCycleState != 'deleted'
					AND SORTED_COLUMN IS NOT
					NULL
				&amp;lt;/fixedPart&amp;gt;
				
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You also have to create a schema with with num_bc (num_schema in the following code), add this schema to your three types, and create in this schema the field "num_bc"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	&amp;lt;doctype  name="facture" extends="Document"&amp;gt;
	    &amp;lt;schema name="num_schema" /&amp;gt;
		&amp;lt;schema name="facture_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;

	&amp;lt;doctype  name="b1" extends="Document"&amp;gt;
        &amp;lt;schema name="num_schema" /&amp;gt;
		&amp;lt;schema name="b1_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;

	&amp;lt;doctype  name="b2" extends="Document"&amp;gt;
	    &amp;lt;schema name="num_schema" /&amp;gt;
		&amp;lt;schema name="b2_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You also can do it with hierachy with a supertype&lt;/P&gt;
&lt;P&gt;For example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	&amp;lt;doctype name="myCustomSuperType" extends="Document"&amp;gt;
		&amp;lt;schema name="myCustomSuperType_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;

	&amp;lt;doctype  name="facture" extends="myCustomSuperType"&amp;gt;
		&amp;lt;schema name="facture_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;

	&amp;lt;doctype  name="b1" extends="myCustomSuperType"&amp;gt;
		&amp;lt;schema name="b1_schema" /&amp;gt;
	&amp;lt;/doctype&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope this helps you.&lt;/P&gt;
&lt;P&gt;EDIT: This solution should also work for you without creating a new schema (using parameters instead of predicates)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fixedPart&amp;gt;
    ecm:isCheckedInVersion = 0 AND
    ecm:currentLifeCycleState != 'deleted' AND
    ( ecm:primaryType = 'bc' OR ecm:primaryType = 'bl' OR ecm:primaryType = 'facture'  ) AND
    ( bc:num_bc = ? OR
      b1:num_bc = ? OR fctr:num_bc = ?) ) 
  &amp;lt;/fixedPart&amp;gt;      
&amp;lt;/whereClause&amp;gt;
  &amp;lt;parameter&amp;gt;#{searchDocument.liasse_search.num_bc}&amp;lt;/parameter&amp;gt;
  &amp;lt;parameter&amp;gt;#{searchDocument.liasse_search.num_bc}&amp;lt;/parameter&amp;gt;
  &amp;lt;parameter&amp;gt;#{searchDocument.liasse_search.num_bc}&amp;lt;/parameter&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://answers.nuxeo.com/general/q/d0f8a109a7fc43689bc08e1fbc129053/About-the-coreQueryPageProvider-and-Predicate-fixedPart" target="test_blank"&gt;https://answers.nuxeo.com/general/q/d0f8a109a7fc43689bc08e1fbc129053/About-the-coreQueryPageProvider-and-Predicate-fixedPart&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 15:57:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/search-results-different-document-types/m-p/320496#M7497</guid>
      <dc:creator>JVent_</dc:creator>
      <dc:date>2015-07-23T15:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Search results different Document types</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/search-results-different-document-types/m-p/320497#M7498</link>
      <description>&lt;P&gt;[JVent](https&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2015 11:17:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/search-results-different-document-types/m-p/320497#M7498</guid>
      <dc:creator>Dalal_</dc:creator>
      <dc:date>2015-07-24T11:17:01Z</dc:date>
    </item>
  </channel>
</rss>

