I am using inbound filters to exclude items out of my Coveo for Sitecore index but now I would like to know how to apply this type of filter directly on the search interface using the JS UI.
My guess would be to use the filterField defined here: https://developers.coveo.com/display/JsSearch/SearchInterface+Component#SearchInterfaceComponent-filterField
Still, I am not a 100% sure on how to use it to filter out items from a certain template. Anyone has a code snippet for this?
You can do this. Filter field is not what you are looking for. In your case, you want to use hiddenExpression.
<div class="CoveoSearchInterface" data-hidden-expression="NOT @myfield==something"></div>
If you want to configure this through the Sitecore interface (which makes it easier to deploy on content delivery servers) I would suggest to use the Filter Expression defined on the Coveo Search component. You can use the "where the item template is specific template" rule to make it easier to pick a specific template from Sitecore tree.
Refer to the section Adding a Filter Expression from this page: https://developers.coveo.com/display/sitecore/Inserting+and+Customizing+a+Search+Interface+Component
The other option would be to add an hiddenExpression directly in the markup of the ascx search component.
Hi Nick, Rule Editor is only available for the Entreprise Edition. If we would like to do the same thing with Hidden Expression. Is that the right way to do it ? (This is not working for me)
<div id="search" class="CoveoSearchInterface" data-enable-history="@Model.EnableHistory" data-results-per-page="@Model.ResultsPerPage" data-excerpt-length="@Model.ExcerptLength" data-hide-until-first-query="@Model.HideUntilFirstQuery" data-auto-trigger-query="@Model.AutoTriggerQuery" data-hidden-expression="@@ftemplateid11006=85972434-191e-4359-b359-dac4638ddfb5"> ... </div>