public class UmbracoTreeSearcherFieldsComposer : IUserComposer
{
public void Compose(Composition composition)
{
composition.RegisterUniqueFor<IUmbracoTreeSearcherFields, CustomUmbracoTreeSearcherFields>();
}
}
And I created my custom tree searcher class:
public class CustomUmbracoTreeSearcherFields : UmbracoTreeSearcherFields
{
public CustomUmbracoTreeSearcherFields(ILocalizationService localizationService) : base(localizationService)
{
}
public override IEnumerable<string> GetBackOfficeDocumentFields()
{
return new List<string>(base.GetBackOfficeDocumentFields()) { "contentBlock" };
}
}
Could you let me know which specific Umbraco version (major, minor, patch) you are using, and what datatype the "contentBlock" property is?
Kind regards,
Corné
EDIT: On second glance, before answering, could you try and add the IInternalSearchConstants interface on your CustomUmbracoTreeSearcherFields class? It appears as though that could be part of what's missing!
I using the latest version 8.15.5. That's not the correct property in this snippet, but I want to add a nested content property. I added this property also for my frontend examine search and it works great.
I tried to add the IInternalSearchConstants interface, but I'm not sure. Do I have to add something in there? I tried also with IUmbracoTreeSearcherFields. It still not working.
Even though Nested Content is stored as JSON, in theory you should be able to search through it using Examine. Could you check if the property name is correct, using the Examine Management Dashboard under Settings?
Try searching for the page you're looking for in the ExternalIndex, and click on the "## fields" button to see the indexed Field values, which should hopefully tell you all the indexed properties of your document.
I don't get results in the ExternalIndex, only in InternalIndex. Is this why it not works? Property name is definitely correct and I can find it only in InternnalIndex?! But it works for my frontend solution. In ExternalIndex I only get media stuff.
My apologies, you are correct, the InternalIndex is used for the back-office search and contains published & unpublished content, the ExternalIndex is used for building your own search implementation!
For the issue itself... without reproducing it myself at this moment I am stumped... I'll see if I can reproduce your setup at a later point in time, but I have a feeling that the issue is because your property is of type Nested Content. If anyone else has any suggestions in the meantime, feel free!
I'm sure it work with Nested Content. I tried it with another property of type Repeatable textstrings and it still not working. I using both properties for my frontend search solution and there it works. I don't know what is missing, but I think the properties are fine.
Adding custom properties to backoffice search
Hi all,
I'm trying to add custom properties to backoffice search in Umbraco 8. I followed the documentation:
https://our.umbraco.com/Documentation/Extending/Backoffice-Search/index-v8_6
But it still not working.
I added the composer:
And I created my custom tree searcher class:
Any suggestions why it is not working?
Hi Dominik,
Could you let me know which specific Umbraco version (major, minor, patch) you are using, and what datatype the "contentBlock" property is?
Kind regards,
Corné
EDIT: On second glance, before answering, could you try and add the IInternalSearchConstants interface on your CustomUmbracoTreeSearcherFields class? It appears as though that could be part of what's missing!
Hi Corné,
I using the latest version 8.15.5. That's not the correct property in this snippet, but I want to add a nested content property. I added this property also for my frontend examine search and it works great.
I tried to add the IInternalSearchConstants interface, but I'm not sure. Do I have to add something in there? I tried also with IUmbracoTreeSearcherFields. It still not working.
Hi Dominik,
Even though Nested Content is stored as JSON, in theory you should be able to search through it using Examine. Could you check if the property name is correct, using the Examine Management Dashboard under Settings?
Try searching for the page you're looking for in the ExternalIndex, and click on the "## fields" button to see the indexed Field values, which should hopefully tell you all the indexed properties of your document.
Hi Corné,
I don't get results in the ExternalIndex, only in InternalIndex. Is this why it not works? Property name is definitely correct and I can find it only in InternnalIndex?! But it works for my frontend solution. In ExternalIndex I only get media stuff.
My apologies, you are correct, the InternalIndex is used for the back-office search and contains published & unpublished content, the ExternalIndex is used for building your own search implementation!
For the issue itself... without reproducing it myself at this moment I am stumped... I'll see if I can reproduce your setup at a later point in time, but I have a feeling that the issue is because your property is of type Nested Content. If anyone else has any suggestions in the meantime, feel free!
I'm sure it work with Nested Content. I tried it with another property of type Repeatable textstrings and it still not working. I using both properties for my frontend search solution and there it works. I don't know what is missing, but I think the properties are fine.
Thank you for your help and time Corné.
is working on a reply...