AI OnAI Off
Hello Henrik,
You can create an extension method for ArticlePage type and call it LocationTitle, for example. Then use it to configure a convention in the initialization module:
SearchClient.Instance.Conventions .ForInstancesOf<ArticlePage>() .IncludeField(x => x.LocationTitle());
I wounder what is the best way to include content that should be searchable but does not exist on the content. Take this for example.
I have a ContentType that looks like this:
Location here will be an integer (id) that is a link to another system and we want to save that in the property.
But we want the visitors to be able to search on the name of the location and get all the articles for that location.
So... the ContentType will have a property with a value like this "23", but we want the visitors to be able to search for its name (like New York).
The way we have solved it (but I think is not the best way) is to add another property on the PageType that looks like this:
It does not feel good to do this, mainly because I am putting logics inside the model and that is not good and it will be run every time this page will be requested even though it is only interesting when adding/updating it to the index.
Are there any other better way to do this?