Sitecore field suffix hash issues
We are sending coveo-rest queries ourselves via json, and thus need to convert "friendly" field names to their coveo counterparts. Eg. "myfield" = "fmyfield1234"
We found the utility function that does the conversion works but for some reason was nonperformant and since we were converting the same field names every time we just cached the first result.
The problem though is it seems like sometimes those hashes change, or otherwise don't match the field names in the source we want to hit? For example, we might have cached @fmyfield1234 but we see the field missing, we go look at the index and see it's @myfield4567 or something. We suspect someone did an index rebuild or something that reset that hash, but we're not sure. It seems like if we bounce IIS (our application is mvc.net) to clear our cache, everything is fine (for a while….).
Can you tell us: a) does the suffix hash # ever change? we thought maybe sometimes doing an index rebuild via the sitecore interface or something can occasionally change that #? b) does this sound like a familiar cm/cd issue? how can we assure that multiple coveo indexes share the same suffix? c) recommended or not, can we turn the suffixing off altogether? d) is there some method call to determine the suffix programatically?
a) No. The field hash is computed from the source name. This means that if your source changes in name, the hash will change.
b) By explicitely setting the source name in your Coveo indexes configurations. The name has to be the same for every CMs and CDs.
<index [...] <sourceName>hello</sourceName>
d) Yes, the ToCoveoFieldName method. For the hash only, no, there is none. If you want to implement one, you can still look at the code in the CoveoIndexNamesBuilder from the Framework assembly.
This translation has been ported client-side (next release? I will have to confirm). Maybe this will solve some of your performance issues.