The runAsync="false" is for debugging purposes. When saving/publishing documents this works fine and both published and unpublished documents are saved into the index. However when rebuilding the index, ie. with the following code:
var indexProvider = ExamineManager.Instance.IndexProviderCollection["B2CIndexer"];
indexProvider.RebuildIndex();
Examine only re-indexes published nodes, and not the unpublished ones, even though supportUnpublished="true". I need to rebuild the index quite regularly, and there are a lot of nodes in the project so manually saving them is not possible.
Any idea how I can get the index rebuild to also index unpublished nodes?
Seeing the same issue here - unpublished nodes don't get added to the index until they are saved. So if the index ever gets rebuilt, they don't include the unpublished nodes.
var indexProvider = ExamineManager.Instance.IndexProviderCollection["B2CIndexer"]; var documentType = DocumentType.GetByAlias("DocumentTypeToIndex"); foreach (var doc in Document.GetDocumentsOfDocumentType(documentType.Id).Where(doc => doc.Creator != null && !doc.IsTrashed)) { indexProvider.ReIndexNode(doc.ToXDocument(false).Root, IndexTypes.Content); }
In my case I needed it for a specific document type, but basically you just get all the documents that you want to reindex and go through them in a loop. It's quite slow though.
Examine RebuildIndex not indexing unpublished nodes
I'm using an Examine index to index both published and unpublished nodes. I'm using Umbraco 4.9.0 on Windows 2008R2, IIS 7.
ExamineIndex.config (partial):
The runAsync="false" is for debugging purposes. When saving/publishing documents this works fine and both published and unpublished documents are saved into the index. However when rebuilding the index, ie. with the following code:
Seeing the same issue here - unpublished nodes don't get added to the index until they are saved. So if the index ever gets rebuilt, they don't include the unpublished nodes.
Did you ever get anywhere on this?
This is related, though still not fixed unfortunately :(
I just created a custom reindexing method:
In my case I needed it for a specific document type, but basically you just get all the documents that you want to reindex and go through them in a loop. It's quite slow though.
is working on a reply...