Fixes examine lookup for children to ignore recycled media

This commit is contained in:
Shannon
2014-04-23 13:34:57 +10:00
parent 9bbe8e7a93
commit cc3a6f8c7a

View File

@@ -384,7 +384,11 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
{
//first check in Examine as this is WAY faster
var criteria = searchProvider.CreateSearchCriteria("media");
var filter = criteria.ParentId(parentId);
var filter = criteria.ParentId(parentId).Not().Field(UmbracoContentIndexer.IndexPathFieldName, "-1,-21,".MultipleCharacterWildcard());
//the above filter will create a query like this, NOTE: That since the use of the wildcard, it automatically escapes it in Lucene.
//+(+parentId:3113 -__Path:-1,-21,*) +__IndexType:media
ISearchResults results;
//we want to check if the indexer for this searcher has "sortOrder" flagged as sortable.