简体   繁体   中英

Umbraco 5: site search

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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM