Exemplo n.º 1
0
        private IBulkIndexOperation <T> GetMeta(BulkIndexDescriptor <T> desc, T data)
        {
            var result = desc.Index(IndexName).Id(data.Id);

            if (data is WrapperWithDoc)
            {
                result.Pipeline("attachments");
            }

            return(result);
        }
Exemplo n.º 2
0
        private BulkIndexDescriptor <JObject> ConfigureItem(BulkIndexDescriptor <JObject> idx, IHit <JObject> hit, string targetIndex)
        {
            idx.Index(targetIndex);
            idx.Type(hit.Type);
            idx.Id(hit.Id);
            idx.Version(hit.Version);
            idx.Document(hit.Source);

            if (hit.Fields?.FieldValuesDictionary != null && hit.Fields.FieldValuesDictionary.ContainsKey("_parent"))
            {
                idx.Parent(hit.Fields.FieldValuesDictionary["_parent"].ToString());
            }

            return(idx);
        }
        private BulkIndexDescriptor<JObject> ConfigureItem(BulkIndexDescriptor<JObject> idx, IHit<JObject> hit, string targetIndex) {
            idx.Index(targetIndex);
            idx.Type(hit.Type);
            idx.Id(hit.Id);
            idx.Version(hit.Version);
            idx.Document(hit.Source);

            if (hit.Fields?.FieldValuesDictionary != null && hit.Fields.FieldValuesDictionary.ContainsKey("_parent"))
                idx.Parent(hit.Fields.FieldValuesDictionary["_parent"].ToString());

            return idx;
        }