Umbraco 5: site search

359 views Asked by At

Is there a viable way to search an Umbraco 5 site? I've read a lot on XLST search, but nothing using MVC3. It also seems that Examine is coming a little bit buggy, as even the backoffice has lost the search box that was present in v4. Any ideas?

2

There are 2 answers

0
Jigar Pandya On BEST ANSWER

As you know Umbraco V5 is retire; you can try 4.x and do the above with user controls that do search logic using umbraco node factory.

Hope you get my views.

1
Tom Dudfield On

I've created a very basic search, it might not be best way but it gives the results I need.

var results = Hive.QueryContent().OfRevisionType(FixedStatusTypes.Published).ToList().Where(c => c.AllAncestorIds().Any() && c.Name.ToLowerInvariant().Contains(query.ToLowerInvariant()) && c.Attribute<bool>("excludeFromSearch") == false).ToList();

OfRevisionType(FixedStatusTypes.Published) returns published pages c.AllAncestorIds().Any() stops deleted items being returned