static private GetDocument ( IndexDocumentData docData ) : Lucene.Net.Documents.Document | ||
docData | IndexDocumentData | |
return | Lucene.Net.Documents.Document |
internal static Document GetDocument(IndexDocumentData docData)
{
var buffer = docData.IndexDocumentInfoBytes;
//if (buffer.Length == 0)
// return null;
var docStream = new System.IO.MemoryStream(buffer);
var formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
var info = (IndexDocumentInfo)formatter.Deserialize(docStream);
return CreateDocument(info, docData);
}
public static Document CreateDocument(Node node) //caller: tests
IndexDocumentInfo::GetDocument ( int versionId ) : Lucene.Net.Documents.Document |
// caller: IndexPopulator.Populator public void RepopulateTree(string path) { using (var op = SnTrace.Index.StartOperation("IndexPopulator RepopulateTree")) { var writer = IndexManager.GetIndexWriter(false); writer.DeleteDocuments(new Term(LucObject.FieldName.InTree, path.ToLowerInvariant())); try { var excludedNodeTypes = LuceneManager.GetNotIndexedNodeTypes(); foreach (var docData in StorageContext.Search.LoadIndexDocumentsByPath(path, excludedNodeTypes)) { var doc = IndexDocumentInfo.GetDocument(docData); if (doc == null) // indexing disabled { continue; } writer.AddDocument(doc); OnNodeIndexed(docData.Path); } writer.Optimize(); } finally { writer.Close(); } op.Successful = true; } }