CBOR with Nest and ingest-attachment plugin

(siva ramalingam) #1

I have tried the following with the Nest client

public class Document
    [Text(Ignore = true)]
    public string Id { get; set; }
    public byte[] Content { get; set; }
    public Attachment Attachment { get; set; }

public class DumpFileReader
    public readonly IEnumerable<string> InputFiles;

    public readonly int FilesCount;

    public IEnumerable<Document> Documents
            return this.InputFiles.SelectMany(this.LazilyReadFiles);


    #region constructor

    public DumpFileReader(string filesDirectory, string fileTypes="*.xml")
	this.InputFiles = GetFiles(filesDirectory, fileTypes);
	this.FilesCount = this.InputFiles.Count();

public IEnumerable<Document> Packages => this._files.SelectMany(this.LazilyReadDumps);

public IEnumerable<Document> LazilyReadDumps(string file)
    var bytesFile = File.ReadAllBytes(file);
    yield return new Document { Id = Path.GetFileName(file), Content = bytesFile };

This seems to index correctly when i use the ingest-attachment processor. Is this the right way to use CBOR format? I can not seem to find any examples on the usage.

(siva ramalingam) #2

I guess no one uses this approach, something wrong with it?

(David Pilato) #3

@Martijn_Laarman do you know? I'm not familiar with Nest.

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.