Specify a specific entry type in paramaters I am currently searching within multiple sections on my site.
I'd like to limit one of the sections (courses) to a specific entry type (cce)?
Any help would be greatly appreciated!
{% set params = { 
    section: [ 'pages', 'careerPaths', 'courses', 'events', 'eventsIndex', 'news', 'newsIndex', 'programs', 'allPrograms', 'facultyStaff', 'facultyStaffIndex' ], 
    limit: siteVariables.resultsLimitForPagination 
} %}

{# if search term exists, search #}
{% set searchTerm = craft.app.request.getParam('q') %}

{% if searchTerm|length %}
    {% set params = params|merge({ groupBy: ['title'] }) %}
    {% set params = params|merge({ search : searchTerm, orderBy: 'score DESC'}) %}
{% endif %}

{# Query #}
{% set query = craft.entries(params)  %}

{% paginate query as pageInfo, entries %}
I suspect the only way to do this at the moment would be to look up the EntryTypes for each of the desired Sections, and filter just by those—ignoring the section query facet. For example:
{# Map some Section handles into actual Section models, using the Sections Service: #}
{% set sections = ['one', 'two', 'three'] | map((h) =&gt; craft.app.sections.getSectionByHandle(h) %}

{# List your &quot;forbidden&quot; Entry Types in a `sectionHandle:entryTypeHandle` format, so we can filter them out, in a moment: #}
{% set forbiddenEntryTypes = [
  'mySection:entryTypeOne',
  'mySection:entryTypeTwo'
] %}

{% set entryTypes = [] %}

{% for section in sections %}
  {# Get the section's EntryTypes, filtering out any that don't match our &quot;magic&quot; `section:entryType` values in the &quot;forbidden&quot; array, above: #}
  {% set permittedSectionEntryTypes = section.getEntryTypes() | filter((t) =&gt; &quot;#{section.handle}:#{t.handle}&quot; not in forbiddenEntryTypes) %}

  {# Merge anything that passes the test into the main `entryTypes` array: #}
  {% set entryTypes = entryTypes | merge(permittedSectionEntryTypes) %}
{% endfor %}

{% set query = craft.entries({
  type: entryTypes
}) %}

This basically works by assuming you want all types from all sections, then filtering out just a few types from that list.
For example, your forbiddenEntryTypes might look something like this, if you had three other Entry Types in the Courses section…
{% set forbiddenEntryTypes = [
  'courses:night',
  'courses:takeHome'
] %}

…where cce is allowed, because it's returned by the section, but not explicitly filtered out. You'll have to update this if/when you add more Course types!

Keep in mind that the sectionHandle:entryTypeHandle format is not a Craft feature, it's just a way for us to compare Section + Entry Type handles at once (note the way we build the &quot;#{section.handle}:#{t.handle}&quot; string when filtering down the Entry types)!