How to switch to web index for rest results in view rendering
When using /sitecore/layout/Models/Coveo/Search Model, and the ToCoveoFieldName method from that model, the aq that is used references the master index identifier. eg., aq=%40fisz32xarticlez32xpage34822%3D1, where 34822 is the number used by my local master index.
How can we switch out that number, since are default pipeline is filtering out items from anything but the web index, this means we won't see any results.
I've tried this both within content editor, and in an incognito window.
The hash mechanic serves the purpose of isolating your environments.
Coveo for Sitecore uses the current context item to get which environment it should target. Meaning a search page within the master database should return items from the master database, and the same thing happens with the web database. This way, the environments stay separated and have no impact on each other.
`ToCoveoFieldName` translates fields into a field name that is _only_ available in one environment. This way, a simple filter on any field like `@fisz32xarticlez32xpage34822` should only return documents from that environment.
The simple act of adding a query with any of those translated fields should give you the items you need, thus not requiring any pipeline to filter items to return only those in one environment.
So I really think the right way to solve your problem would be by:
- Removing the filter that only gets Web items
- Adding a simple query with a translated field to separate the environments (which you already do with `@fisz32xarticlez32xpage34822`)
Let us know if this works for you or if you need any further help.