Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am using Examine to return some nodes in certain document type alias.
Refering to this document:
results = searcher.CreateQuery().Field("__IndexType", "content").And().Field("__NodeTypeAlias", "client").Execute();
All is perfect if there are no deleted nodes, but if there, I get some issues like counting the results and other things because of those deleted nodes.
The question is, how to avoid deleted nodes from returning ?
I noticed that when I empty the recycle bin, the issue will be gone.but I think this wouldn't be the perfect solution.
Can you help guys??
Have you tried setting 'supportUnpublished' to false on the indexer at ExamineSettings.config?
Do you know how to implement this on Umbraco8 ? , because Umbraco8 project doesn't have Examine config file.
I'm having the same issue in Umbraco 8. How can we exclude the deleted nodes from appearing in the search?
I have the same issue. My query returns deleted records. Does anyone have a solution?
I found a work around. I attach to ContentService.Trashing += ContentService_Trashing; event. Keep in mind that when you delete an item in the umbraco admin none the following event is fired:
ContentService.Trashing += ContentService_Trashing;
which is why I attach to ContentService.Trashing. So In ContentService_Trashing method I manually remove this item from the search idnex:
private void ContentService_Trashing(IContentService sender, MoveEventArgs<Umbraco.Core.Models.IContent> e)
foreach (var item in e.MoveInfoCollection)
if (item.Entity.ContentType.Alias == "articleDetailsPage")
if (_examineManager.TryGetIndex("NewsSearchIndex", out index))
if (_examineManager.TryGetIndex("ExternalIndex", out index))
In my code I have configured custom index for my articles. If the element is articleDetails it should be removed from my custom index and the external idex as well.
I think it can be an issue when rebuilding indexes, in v7 it easy supportUnpublished=false as was sad before
without access to ExamineSettings.config
I think it can work with query over path property, when page deleted it moved under -10 query should be not in path: -10*
I found checking the parentID != -1 works
if (Int32.Parse(result.Fields["parentID"] .ToString()) != -1)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted