How to Index guids in Coveo keeping the original format – Part 1

Recently I have been working on a Sitecore project in which I needed to index a sitecore item ID and keep it`s original guid format using Coveo. At indexing time Coveo by default parses all guids to a short guid format.

So for example this guid {FBC05E55-55CA-443C-A3BA-7AE5AA14E2CF} would be transformed to this value fbc05e5555ca443ca3ba7ae5aa14e2cf after indexed.

This is done because there is a converter associated with the type Sitecore.Data.ID(which is the type of the item ID) that will parse that specific type at indexing time from a guid to a short guid.

As I was looking for options I posted a question on Coveo’s answers forum and got the suggestion of creating a custon conversionType and a custom type to get that done.

Understanding conversionTypes

Conversion types are useful to map how Coveo Enterpresie Search handles each type encountered at indexing time(more on the conversion process here). Taking the example described above when Coveo is indexing, it will look for each type of the fields being indexed and convert that type using a converter associated with that type. Complicated right?

You can read it as the following: every time Coveo indexes a guid it will use the converter to make a guid become a short guid. The same goes for other types.

Ok but where is this mapping done? I’m glad you asked ūüôā

If you open your Coveo.SearchProvider.config file and look for the conversionTypes section you will notice that the type Sitecore.Data.ID is associated with the conversionType IndexFieldGuidValueConverter. This will make sure that guids become short guids at indexing time.

The conversion itself happens on the method CovertTo. The ConvertTo method for this class is defined like this:

public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
return ID.Parse((Guid)value).ToShortID().ToString().ToLowerInvariant();
}

On part 2 of this post I will explain how I to implement a custom converter and have a guid being indexed with its original format.

Upgrading cause the Sitecore interface to stop working. Here is how I got it fixed

Here is the scenario for today’s post:

You are upgrading Sitecore and after you have gone through the steps and you log into Sitecore, you notice that when you click on the Sitecore Desktop  or Content Editor icons nothing happens.

What could be wrong?

I had this exact behavior while upgrading Sitecore 8.0 update 3 to 8.0 update 7. When I started troubleshooting I opened Sitecore logs and noticed that there was no errors being captured but it did have a duplicate setting warning. In my case this was the message I would get on the log file:

9008 17:08:16 WARN¬† A duplicate setting “WebEdit.JQueryUIStylesheet” has been detected in the Sitecore.ExperienceEditor.config file. The value of the setting will be changed to “/sitecore/shell/Controls/Lib/jQuery/jQueryUI/1.10.3/smoothness/jquery-ui-1.10.3.min.css”.

So what I did was open the showconfig page (http://hostname/sitecore/admin/showconfig.aspx) and checked on the output of it all references to the WebEdit.JQueryUIStylesheet configuration.

It turned out to have 2 references to it. I removed one of them which got introduced as part of the upgrade by mistake and reloaded Sitecore. After that Sitecore behaved normally.

Hoping this could be useful for others!

To see the same post in portuguese click here

Ao atualizar, a interface do Sitecore parou de funcionar. Eis como eu resolvi esse problema.

Eis o cen√°rio do post de hoje:

Voc√™ est√° fazendo o upgrade do Sitecore e depois que voc√™ finalizou o passos do upgrade, ao logar no Sitecore, voc√™ percebe que quando clica nos icones da interface do desktop ou do editor de conte√ļdo nada ocorre.

O que pode estar errado?

Eu tive este exato problema, ao fazer o upgrade da versão 8.0 update 3 para a versão 8.0 update 7. Ao buscar pela causa do problema, eu verifiquei nos logs do Sitecore e percebi que não haviam erros sendo lançados, porém havia uma mensagem de aviso, dizendo que havia uma configuração duplicada. No meu caso a mensagem era a seguinte:

9008 17:08:16 WARN¬† A duplicate setting “WebEdit.JQueryUIStylesheet” has been detected in the Sitecore.ExperienceEditor.config file. The value of the setting will be changed to “/sitecore/shell/Controls/Lib/jQuery/jQueryUI/1.10.3/smoothness/jquery-ui-1.10.3.min.css”.

O que eu fiz foi abrir a página do showconfig  (http://hostname/sitecore/admin/showconfig.aspx) e verifiquei por todas as referências a configuração WebEdit.JQueryUIStylesheet.

Eu vi ao fazer essa busca que haviam duas referências para essa configuração. Eu removi uma delas, que eu sabia que havia sido introduzida por engano, como parte do upgrade. Depois eu recarreguei o Sitecore e tudo voltou a funcionar normalmente.

Espero que essa dica seja √ļtil para outros na tarefa de fazer o upgrade!

Para ver o mesmo post em inglês

Ao fazer o upgrade do Sitecore o web.config excedeu o tamanho maximo? Eis como voc√™ pode resolver isso

Recentemente eu trabalhei em um projeto de upgrade do Sitecore, e quando eu havia terminado o processo de upgrade eu tentei rodar o Sitecore e me deparei com o seguinte erro:

“Cannot read configuration file because it exceeds the maximum file size”

O erro diz claramente que o não foi possível ler o arquivo de configuração porque o tamanho máximo dor arquivo foi excedido. Eu pesquisei e encontrei este link com os passos para resolver:

  1. Abra o editor de registro – Iniciar e digite regedit;
  2. Navegue at√© a entrada:HKLM\SOFTWARE\Microsoft\InetStp\Configuration (Se a configura√ß√£o “Configuration” n√£o existir, crie ela);
  3. Adicione/altere o valor DWORD de MaxWebConfigFileSizeInKB.  O valor padrão é 250. No meu caso eu setei o valor para 700. A minha configuração ficou assim definida:

post1

4. Abra o cmd e rode o comando “iisreset” para aplicar a nova restri√ß√£o definida.

Depois que eu reiniciei o meu IIS, o Sitecore voltou a funcionar normalmente.

Se voc√™ n√£o quiser alterar o tamanho do web.config existe uma outra forma que voce consegue fazer isso, conforme sugerido por @jammykam¬†e¬†@dschmpsv¬† que √© dividir o arquivo em v√°rios. Por exemplo, se voce estiver usando o m√≥dulo IIS URL Rewrite, por padr√£o este modulo atualiza o web.config. Voce pode neste caso mover todas as regras para um √ļnico arquivo e referenci√°-lo no web.config. Com essa abordagem √© possivel reduzir o tamanho do arquivo.

Para ver este mesmo post em inglês clique aqui

 

Upgrading Sitecore caused your web.config to exceed the maximum file size? Here is how you fix it

Recently I have been working on a Sitecore upgrade and after I was done upgrading it and tried to load Sitecore I got the following error:

“Cannot read configuration file because it exceeds the maximum file size”

I did some research and found this very useful link with the steps to fix this:

  1. Open registry editor – Start > Run > regedit.exe.
  2. Navigate to key: ¬†HKLM\SOFTWARE\Microsoft\InetStp\Configuration (If there is no ‘Configuration’ key, create it)
  3. Add/change DWORD value MaxWebConfigFileSizeInKB. The default value is 250 KB. Each SIP domain requires about 3 KB for rewrite rules, so the new value should be not less than 3 * (expected count of SIP domains). In my case I set the value to 700. This is how it should look like:

post1

4. Run “iisreset” command in CMD to apply the new restriction value.

After I reset my IIS Sitecore started working again.

If you don’t want to change the max size of the web.config there is one other thing you can do as suggested by @jammykam and @dschmpsv which is split the configuration file into multiple ones. For example if you are using the IIS URL Rewrite module, by default it will update your web.config files. You can in this case set all your rewrite rules into a single config file and reference it on the web.config. With this approach you also reduce the size it. Hopefully this will be usefull for anyone working with upgrades in the future!

To check this post in portuguese click here