Example #1
0
        public async Task <IndexDocumentData> SaveIndexDocumentAsync(Node node, IndexDocumentData indexDocumentData,
                                                                     CancellationToken cancellationToken)
        {
            if (node.Id == 0)
            {
                throw new NotSupportedException("Cannot save the indexing information before node is not saved.");
            }

            node.MakePrivateData(); // this is important because version timestamp will be changed.

            var completedDocument       = IndexDocumentProvider.CompleteIndexDocument(node, indexDocumentData.IndexDocument);
            var serializedIndexDocument = completedDocument.Serialize();

            await SaveIndexDocumentAsync(node.Data, completedDocument, cancellationToken).ConfigureAwait(false);

            return(CreateIndexDocumentData(node, completedDocument, serializedIndexDocument));
        }
Example #2
0
 internal static IEnumerable <Fieldable> GetFields(IndexDocumentInfo info, SenseNet.ContentRepository.Storage.Data.IndexDocumentData docData)
 {
     Debug.WriteLine("%> adding custom fields for " + docData.Path);
     return(Instance.GetFieldsPrivate(info, docData));
 }