public static class LuceneHelper
{
public static void ReindexNode(int id, string indexName, string indexType)
{
var xmlStr = umbraco.library.GetXmlNodeById(id.ToString()).Current.OuterXml;
var xml = XElement.Parse(xmlStr);
ExamineManager.Instance.IndexProviderCollection[indexName]
.ReIndexNode(xml, indexType);
}
}
I'm not sure how you get the XML for a node now in v8, but hopefully it gives you a starting point.
I think you have to do it your way. Unless I'm missing something, new ValueSet(id) will just create an object with that ID and no other fields populated, so indexing that won't do the right thing.
Reindex single node in v8
Anyone know how to reindex a single node in ExternalIndex in v8?
I used to do the following in v7
I'm not sure how you get the XML for a node now in v8, but hopefully it gives you a starting point.
Hi,
I simply use this:
where id is string
Ooh, didn't know you could just
new ValueSet(id)
I got it working by doing
index.IndexItems(_valueSetBuilder.GetValueSets(arrayOfIContents));
index is the IIndex, _valueSetBuilder is IPublishedContentValueSetBuilder, and e is coming from the Published event on the content service
I think you have to do it your way. Unless I'm missing something,
new ValueSet(id)
will just create an object with that ID and no other fields populated, so indexing that won't do the right thing.is working on a reply...