1

This is the first time we working on Azure Search and Sitecore SXA

we are facing a problem related to

Exception: Sitecore.ContentSearch.Azure.Http.Exceptions.AzureSearchServiceRESTCallException Message: {"error":{"code":"","message":"The request is invalid. Details: definition : Invalid index: The index contains 1076 leaf fields (fields of a non-complex type). An index can have at most 1000 leaf fields.\r\n"}}

How do i check on which index am getting this error?

After reading about it i understand there are 2 ways to solve this issue

  1. Set indexAllFields to false and include only necessary fields to the index
  2. Use the Exclude fields config file to exclude unnecessary fields

Being a SXA and Azure Search Newbie i seem to have lost my way , please find my questions below

  1. how can i check which index has crossed the maximum field limit on the azure portal
  2. I also see two indexes per database on the Azure Search explorer being created one for each database sitecore-core-index and sitecore-core-index-secondary , sitecore-master-index and sitecore-master-index-secondary , sitecore-web-index and sitecore-web-index-secondary , what are these secondary indexes
  3. There are also 2 other indexes related to SXA sitecore-sxa-master-secondary and sitecore-sxa-web-secondary , what are these indexes? ,I read that Sitecore SXA 1.7 onwards allows to configure index per site, i am yet to configure Index per site on SXA , yet i see these two indexes on Azure portal, am i missing anything?
  4. where are my content items indexed ? sitecore-sxa-master-secondary or sitecore-master-index ?
  5. would be great if anyone can provide a best practice guide on how to index content per site in SXA and include on items based on template type and exclude unwanted fields
1
  1. Could be in your logs but if it is related to a sxa query, it should be the sxa-master or sxa-web index (and probably both)
  2. "secondary" names come from the switch-on-rebuild functionality (https://doc.sitecore.com/developers/90/platform-administration-and-architecture/en/zero-downtime-index-rebuild-in-azure-search.html) It's on by default and each time you do a rebuild Sitecore will use the non-active index to perform the rebuild and switch when it's done
  3. indexes with "master" in them are from the master database (those with "web" are from the web database). For information about those databases: https://doc.sitecore.com/developers/90/platform-administration-and-architecture/en/experience-manager-storage-roles.html You can configure indexes per site in SXA - those might help you if you have a huge index and want to split them based on site and/or language.
  4. It depends. One of them will be active. Check https://sitecore.stackexchange.com/a/16534/237 for an more in depth answer.
  5. Writing best practices would go a bit far here and -in my opinion- also depends on your project. You can (and should) however remove fields from your index as you hit the limit. SXA has some configuration already in place to remove some fields (check your config, there should be a whole list of excludedfields). You can use that as an example and extend it to remove more fields. In the end, you could also use separate indexes (https://doc.sitecore.com/developers/sxa/18/sitecore-experience-accelerator/en/configure-sxa-indexing.html) as provided by SXA.
  • As it is an SXA site , can i assume the right approach would be to set <indexAllFields> to false in Sitecore.ContentSearch.Azure.DefaultIndexConfiguration.config and include all fields that i would want to index in App_Config\Modules\SXA\Z.Foundation.Overrides\Sitecore.XA.Foundation.Search.Azure.config ? , so that i would have only items that are required to be indexed in my index? – SitecoreNoob Apr 29 at 13:12
  • If you do that on the default index config, that might have some strange side effects (on default components and/or in editing). I would start by removing a few.. – Gatogordo Apr 29 at 13:15
  • wouldnt sitecore have all the fields that it requires for its functioning in the include fields section by default ? , so that there is no un desired behaviour – SitecoreNoob Apr 29 at 13:33
  • For the SXA components, that is an assumption.. I'm not sure about that. And it would also depend on which ones you use. You could easily try and test if it fits your setup. – Gatogordo Apr 29 at 13:51
  • Thanks a lot for your help and patience , i will test it out and get back – SitecoreNoob Apr 29 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.