Best Practices when using PUSH API
So, I know this is a very generic question, but, starting to build a solid basis.
We have an implementation where a push source is being loaded by reading Sitecore data that is needed from a very old Sitecore instance. We then will use it as an external source on our Coveo Search Component.
In this scenario (I wish we had other option, but, have to proceed in this direction) what do you all think we will loose and what can we do to ensure the search works seamlessly. I did few quick experiments by having a search term that exists on random fields on the index and it does seem to work fine.
What I do not know or doubtful of -
1. Metadata -> Is it a good idea to pass in meta data when we are pushing items to Coveo cloud push source?
2. Wont we loose on Free text Search on HTML as obviously this is manual construction of Push source? Or is there a way we can make this happen regardless
Anything else that you all think off as a loss due to this decision. I confirmed with Coveo that on this architecture we can still turn on ML, so, we should be safe there.
A Coveo for Sitecore source is a push source under the cover. Thus, with a custom push source, you should be able to achieve a lot.
I do not think you will lost anything by indexing an old Sitecore instance through a custom push source. Some points to consider:
- If you want to see these results in the search interface facets or sort them, you will need to use the same fields for the old Sitecore items and the ones from the new Sitecore site (I think there is a new one with Coveo for Sitecore installed in it). Since Coveo for Sitecore creates one field per database with different hash, I recommend you to set the fields you are using for facets/sorts/query filters as external first. This way, Coveo for Sitecore will only create one field without an hash. you will be able to set this field value in your custom push source mapping using the pushed items metadata.
- Have you read the Push API documentation? It contains a best practice document.
For your questions:
- Metadata: It is really important to include metadata in your pushed items. Metadata is used in the source mapping to set the index field values. Make sure to send useful metadata that you want to filter on, sort on, or display in your search results.
- A pushed item have a
DocumentBodyparameter. This is the parameter used by Coveo for Sitecore to send the HTML of an indexed Sitecore page item. When processing your old Sitecore instance items, you could detect which ones have a layout and execute similar code to fetch the HTML page from the Sitecore server. Then set
DocumenBodyparameter to the response of the web server. If you do not want to fetch HTML pages, you should at least decide for each item template, which Sitecore field should be free-text searchable. Send the value of those fields as metadata. Make sure to map those metadata to free-text searchable index fields in the source mapping. Note that rich-text fields will be indexed with the HTML elements and the text in those elements (br, div, span, a, table…) will be searchable unless you clean-up the HTML yourself before setting the metadata values.
I hope this helps,