Skip to content

Commit

Permalink
Fixes examine lookup for children to ignore recycled media
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed Apr 23, 2014
1 parent 99d7bf9 commit 949447c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,11 @@ private IEnumerable<IPublishedContent> GetChildrenMedia(int parentId, XPathNavig
{
//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.
Expand Down Expand Up @@ -782,4 +786,4 @@ private void ValidateAndSetProperty(IDictionary<string, string> valueDictionary,
}
}
}
}
}

0 comments on commit 949447c

Please sign in to comment.