Hi,
Please have a look at unified search http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/9/DotNET-Client-API/Searching/Unified-search/. I think that's what you're looking for.
As Johan says, unified search can work but you could also search over multiple types with includetype. We do just that and then returns a custom object.
Read more about it here:
http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/8/DotNET-Client-API/Searching/Searching-over-multiple-types/
Hi Henrik, I like the includetype approach that returns a cusom object. However, I cannot seem to use 'InField' method to search on certain properties. Any ideas?
Thanks
Adam
I solved it by doing this;
I search for a baseclass and then if user have checked on block that they only want certain types I do something like below. ;
IList<Type> types = new List<Type>(); types.Add(typeof(NewsInformationPage)); types.Add(typeof(ProductPage)); searchQuery = searchQuery.FilterByExactTypes(types as IEnumerable<Type>);
Workes like a charm for me.
or something like this I guess would be even cleaner;
searchQuery = searchQuery.FilterByExactTypes(new [] {typeof(InformationPage), typeof(ProductPage)});
/Jens
Oh right, I didn't quite read the whole post :-D Sorry bout that.
Hi all,
I have EPiServer Find setup on a 7.5 site.
Basically, when a search has been performed I need to return two types only (one of 'BasePage' type and the other of media type 'DocumentFile'). The results page will show a Title, Summary and Url for each search result.
I have tried using the MultiSearch method which binds to a custom object that I have created. However, the result object comes back with two collections (one for BasePages and one for DocumentFiles). It also appears that MultiSearch does not support pagination as Take() and Skip() arent available for the query.
Has anyone any advice as to the best way of achieving searching on two types, with pagination support and able to bind to a custom object? Do I need to run two seperate queries and amalgamate the results?
Thanks
Adam