You can easily index extra information by adding extension methods. Here's an example: http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=79729
Hi, Many thanks. How would you apply this so our facets are derived from a categorylist which is a property of a page.
All the examples we have seen regarding facets always seem to reference the pageName rather than any other type.
Thanks again,
Jon
On a second thought, I think the easiest approach in this case would be to do the following:
create facets by using the "SearchCategories" property, which is part of the ISearchContent interface(which is used by unified search).
.TermsFacetFor(x => x.SearchCategories);
On your page classes, ArticlePage, SitePageData, etc. create a property named SearchCategories. By doing this you will override what normally would be indexed, which is the standard category property.
public IEnumerable<string> SearchCategories
{
get
{
foreach (int category in SomeCategoryProperty)
{
yield return Category.GetCategoryName(category);
}
}
}
And then run the cms content indexing job.
Hi,
That is great, many thanks. Second question, How would I get a single string such as DatePublished to come back as a Facet?
Jon
For datetime facets I would recommend using the HistogramFacetFor method
http://find.episerver.com/Documentation/dotnet-api-histogram-facets
The ISearchContent interface contains a couple of DateTime methods that you could override.
http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-Find1/75/DotNET-Client-API/Searching/Unified-search/
Optionally create an extension which returns a string, as referenced in my first reply, and use TermsFacetFor on that
Hi,
I would like to use the Unified Search functionality of FIND to filter search results using our own custom categories and our own Published Date fields as Facets, but I cant see how this can be done - I have searched the internet for days and cant find any documentation about this.
I have used the alternative way:
BUt I would ideally like to use the UnifiedSearch method.
Can you help?
Jon