Coveo for Sitecore 5: The Indexing Services API

Following my last blog post, on which I explained in details what exactly is the Coveo Configuration Services API, this time I’ll take a few minutes to talk a little bit about my favorite set of API methods, the so much loved Coveo Indexing Services API.

The principle here is pretty much the same. Coveo created those self-documented Restful API methods so that we, the Sitecore community, can automate tasks by creating scripts that will call those services. Simple, right?

The difference here is really on the subject of those methods. Now we are talking about more complex operations that you can use freely to create even more sophisticated automation scripts.

giphy

To give you a little taste of what I’m about to share with you, here is a short list of some of my favorite API methods which I’ll explain in details on the next section:

PATCH /coveo/api/index/v1/fields

POST /coveo/api/index/v1/cleanunused

GET/coveo/api/index/v1/limit/summary

POST /coveo/api/index/v1/indexes/[indexname]/rebuild

POST /coveo/api/index/v1/security/identities/synchronize

Fields Section

fields

Basically, a bunch of methods that you can use to fetch, update or even completely replace the current list of indexed fields on your Sitecore instance.

Besides those operations, there is also a method to get the current fields usage limit summary, which will give you a few very useful numbers such as license fields limit, how many fields is your current organization using, how many fields is your current Sitecore instance using, and how many fields you have on your organization that are not being used at all.

To fit with what this last method gives you, Coveo offers the clean up unused fields method, which is very handy when it comes the time delete those old and rusty fields which had their Sitecore instance deleted.

Pro tip: I know that you have that very creative script which is responsible for deleting your Sitecore instances properly and cleaning every single file or database linked to it… It would not harm to add a call to the clean up unused Coveo fields if you are always reaching your license limit. Just saying…

giphy-1

 

Indexes Section

indexes

Now we are dealing with your entire Coveo index. Starting from the basics, you can list the Coveo indexes you have or even make sure their configuration (fields type, for instance) are synchronized with what Coveo has on the platform side of the equation.

But I must admit that my favorite method here is the one responsible for entirely rebuilding your Coveo index. Especially because Coveo requires an initial rebuild after the initial configuration of its package. So if you are creating a script to automate the configuration and activation of the Coveo package, why not automate the initial rebuild as well?

giphy-3

 

Security Section

security

Here we are dealing with the security on your indexed documents. Besides the security cache update that you can execute (entirely or by a specific identity), please pay attention to the synchronize method you see here.

giphy-2

If you somehow ended with a user created/removed on Sitecore but Coveo still is not yet aware of this change, calling this API method can save you a lot of time. Trust me, I’ve seen this a few times in the past, it’s not that hard to mess with the users/roles synchronization between the two parts, especially if you are creating Sitecore virtual users programmatically.

 

Conclusion

This blog post ends the series I had planned about the brand new Coveo for Sitecore 5.

I really hope you have enjoyed the initial overview of the Command-Center, or when I explained in details each one of its sections, or when I wrote about the huge change Coveo made on the field naming and its hashes or even when you learned in first hand that the Coveo Configuration Services API even exists.

2019 is just starting and I can tell you in advance that there is so much more to come this year, so please make sure you follow me on twitter @hsantos_x since that’s the channel that I use more often to share my articles and news in general.

See you soon!

giphy-4

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s