Skip to main content
added 2 characters in body; edited tags; edited title
Source Link
Richard Seal
  • 20.8k
  • 5
  • 44
  • 79

Simple IS there a simple way to get the current Azure Search index name from Sitecore 9.1programatically?

I need to get the current active index name for Sitecore search for logging purposes. Because of the swap on rebuild functionality, I can't simply use the name field of the index, since on alternating rebuilds the name will change from the default to something like "sitecore-master-index-1234"sitecore-master-index-1234. Searching Sitecore SE, it seems like there is no simple of way doing this. I went so far as to look at the disassembled code of Sitecore.ContentSearch.Azure;Sitecore.ContentSearch.Azure, and it seems the field storing this name is marked internal so no one can access it outside of Sitecore.

Is there really no way to get this index name easily?

Simple way to get current Azure Search index name from Sitecore 9.1?

I need to get the current active index name for Sitecore search for logging purposes. Because of the swap on rebuild functionality, I can't simply use the name field of the index, since on alternating rebuilds the name will change from the default to something like "sitecore-master-index-1234". Searching Sitecore SE, it seems like there is no simple of way doing this. I went so far as to look at the disassembled code of Sitecore.ContentSearch.Azure; and it seems the field storing this name is marked internal so no one can access it outside of Sitecore.

Is there really no way to get this index name easily?

IS there a simple way to get the current Azure Search index name programatically?

I need to get the current active index name for Sitecore search for logging purposes. Because of the swap on rebuild functionality, I can't simply use the name field of the index, since on alternating rebuilds the name will change from the default to something like sitecore-master-index-1234. Searching Sitecore SE, it seems like there is no simple of way doing this. I went so far as to look at the disassembled code of Sitecore.ContentSearch.Azure, and it seems the field storing this name is marked internal so no one can access it outside of Sitecore.

Is there really no way to get this index name easily?

Source Link

Simple way to get current Azure Search index name from Sitecore 9.1?

I need to get the current active index name for Sitecore search for logging purposes. Because of the swap on rebuild functionality, I can't simply use the name field of the index, since on alternating rebuilds the name will change from the default to something like "sitecore-master-index-1234". Searching Sitecore SE, it seems like there is no simple of way doing this. I went so far as to look at the disassembled code of Sitecore.ContentSearch.Azure; and it seems the field storing this name is marked internal so no one can access it outside of Sitecore.

Is there really no way to get this index name easily?