Preloading fielddata in c#

Trying to implement preloading fielddata using NEST. I have two questions

  1. How to preload fielddata for mapped child attachment object
  2. After preloading some of the fields, search is still slow for the first run.

Pls someone identify my mistake here

//my code here

var indexResponse = client.CreateIndex(documentsIndex, c => c
.Settings(s => s
.Analysis(a => a
.Analyzers(ad => ad
.Custom("index-file", ca => ca
.CharFilters("html_strip")
.Tokenizer("standard-tokenizer")
.Filters("standard", "lowercase")
)
)
)
)
.Mappings(m => m
.Map(mp => mp
.AllField(all => all
.Enabled(false)
)
.Properties(ps => ps
.Number(n => n
.Name(nn => nn.Id).Fielddata(x=>x.Loading(FielddataLoading.Eager))
)
.Number(n => n
.Name(nn => nn.MatterId).Fielddata(x=>x.Loading(FielddataLoading.Eager))
)
.Number(n => n
.Name(nn => nn.FirmId)
)
.Boolean(n => n
.Name(nn => nn.IsRestricted).Fielddata(x => x.Loading(FielddataLoading.Eager))
)
.Object(a => a
.Name(n => n.Attachment)
.Properties(p => p
.Text(t => t
.Name(n => n.Name)
)
.Text(t => t
.Name(n => n.Content).Store().TermVector(TermVectorOption.WithPositionsOffsets)
.Analyzer("index-file").Fielddata(true)
)
.Text(t => t
.Name(n => n.ContentType).Store()
)
.Number(n => n
.Name(nn => nn.ContentLength).Store()
)
.Date(d => d
.Name(n => n.Date).Store()
)
.Text(t => t
.Name(n => n.Author).Store()
)
.Text(t => t
.Name(n => n.Title).Store()
)
.Text(t => t
.Name(n => n.Keywords).Store()
)
)
)
)
)
));

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