1

As of now i am facing some problem with field bind issue while get the response from coveo, inside the this method ToCoveoFieldName is implemented. Any one can help me on this.

Code snippet

raw.<%= ToCoveoFieldName("field Name", false)

Singh Aswal
  • 379
  • 2
  • 6
  • What problem are you having? It's not clear what your question is. Did you write this code? If not, where did it come from? – underscore_d Jun 16 '20 at 09:30
  • Code is all ready written and code snippet i have shard in my question, just want to know the use of this method and it will be return. – Singh Aswal Jun 16 '20 at 09:54

1 Answers1

0

Since you are having issues with this call, I am assuming that you might be migrating to the Coveo for Sitecore Hive Framework implementation, which mostly shifted from a back-end implementation to a front-end one for all of its major field logic.

This means that ToCoveoFieldName is not available any more on the server side. Instead, there is a JavaScript implementation of the same logic.

For instance, if you want to translate a field to the Coveo format, you can use CoveoForSitecore.Context.fields.toCoveo("field name").

I can see in your question that you are within a result template, there are already two helpers to get you either the field name or the value.

<div data-field={{= coveoFieldName("field name") }}>

and

<div>{{= coveoFieldValue("field name") }}</div>. (This one is the equivalent of calling raw[coveoFieldName("field name")])

Those helpers are explained in more details in the documentation, on the Editing the Content of a Result Template page (for version 5.0+) and Coveo Fields Resources Component page (for versions <5.0 and 4.1+).