I want to filtering on categories and subjects and not all page types have these properties implemented.
Right now I have an interface (ISearchable) that I include on page types and document types that I want to be searchable.
The reason I chose an interface is that I also want to be able to choose which media types to be searchable
I would also get search results for a page if it contains a document that matches my search.
Alternative 1 var results = SearchClient.Instance.Search<IContent>(language) .For(searchText) .Filter(x => x.MatchTypeHierarchy(typeof(ISearchable .FilterForVisitor() .Track() .Skip(pageSize * (pageNo - 1)) .Take(pageSize) .GetContentResult();
Alternativ 2 var results = SearchClient.Instance.Search<ISearchable>(language) .For(searchText) . Filter(x => x.Subject.Match(subjects)) .FilterForVisitor() .Track() .Skip(pageSize * (pageNo - 1)) .Take(pageSize) .GetContentResult();
Alternative 3 var results = SearchClient.Instance.Search<SearchBasePage>(language) .For(searchText) . Filter(x => x.Subject.Match(subjects)) .FilterForVisitor() .Track() .Skip(pageSize * (pageNo - 1)) .Take(pageSize) .GetContentResult(); In this case I skip the I idea of the interface, but I'm not sure how get a search hit for a page if it contains a document.
Alternative 4 Should I use Unified Search? In Joels example http://joelabrahamsson.com/building-a-search-page-for-an-episerver-7-site-with-episerver-find/ He uses unified search, but this is for EPiServer 7 and not 7.5 which media types are new.
Are there any other options that are better than those above?
Please, give me some advice!
EPiServer cms 7.5
EPiServer Find 7.5
I want to filtering on categories and subjects and not all page types have these properties implemented.
Right now I have an interface (ISearchable) that I include on page types and document types that I want to be searchable.
The reason I chose an interface is that I also want to be able to choose which media types to be searchable
I would also get search results for a page if it contains a document that matches my search.
Alternative 1
var results = SearchClient.Instance.Search<IContent>(language)
.For(searchText)
.Filter(x => x.MatchTypeHierarchy(typeof(ISearchable
.FilterForVisitor()
.Track()
.Skip(pageSize * (pageNo - 1))
.Take(pageSize)
.GetContentResult();
Alternativ 2
var results = SearchClient.Instance.Search<ISearchable>(language)
.For(searchText)
. Filter(x => x.Subject.Match(subjects))
.FilterForVisitor()
.Track()
.Skip(pageSize * (pageNo - 1))
.Take(pageSize)
.GetContentResult();
Alternative 3
var results = SearchClient.Instance.Search<SearchBasePage>(language)
.For(searchText)
. Filter(x => x.Subject.Match(subjects))
.FilterForVisitor()
.Track()
.Skip(pageSize * (pageNo - 1))
.Take(pageSize)
.GetContentResult();
In this case I skip the I idea of the interface, but I'm not sure how get a search hit for a page if it contains a document.
Alternative 4
Should I use Unified Search?
In Joels example http://joelabrahamsson.com/building-a-search-page-for-an-episerver-7-site-with-episerver-find/
He uses unified search, but this is for EPiServer 7 and not 7.5 which media types are new.
Are there any other options that are better than those above?
Please, help me to take a good decision!