Using the Searchbox to refine a programmatically-filtered query
Hi - I am building a web page using the Search View (MVC) component. This page returns a filtered list of results (it is only showing News Release pages). Since I am using the free version of Coveo for Sitecore, I do not have access to the rules engine, so I am using the programmatic way of injecting template id filtering into the query (using the args.queryBuilder.constantExpression.add() method as described in this article: https://developers.coveo.com/display/public/SC201410/Adding+Filter+and+Boost+Expressions+Programmatically
When I try this, the search results consistently says "Your query did not match any documents", even if I enter a word that is in the search results. Looking at the query logs in the CES Admin tool, it appears that the search component is not appending my keyword query to the constant expressions defined programmatically, but is issuing just the keyword query.
Is there a way to do this?
What you describe seems perfectly normal (user query ending in q= and your constant filter in cq=). Those are combined inside the index.
Can you validate that the filter you put in cq= effectively matches some items? What happens if you replace it with
@uri (this is an expression that matches everything)?