volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Basic search

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!

#80958
Feb 05, 2014 22:14

You should be using UnifiedSearch. This is the reason UnifiedSearch was built. UnifiedSearch in 7.5 fully support the new media model. 

#80970
Feb 06, 2014 9:21
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.