Ignore a field when creating a mapping on elasticSearch using NEST -


i'm creating index , adding mapping indexdescriptor, have couple of doubts regarding mapping process:

  1. how can avoid index specific field class?
  2. how can boost , specify value of "boostfield" fluent interface configuration?
  3. is indexdescriptor correct place map class fields without using elasticproperty attribute

i'm asking these questions because i'm new using nest , seems current documentation outdated

how i'm creating index:

createindex(indexname, descriptor => descriptor.addmapping<candidatetextinfo>( m => m.mapfromattributes(). boostfield(c=>c.setname(d=>d.headline)).numericdetection()));   public class candidatetextinfo     {         public string profilepicture { get; set; }         public objectid userid { get; set; } //field ignore on mapping         public string name { get; set; }         public string headline { get; set; }         public gender gender { get; set; }         public byte rating { get; set; }         public bool iscompany { get; set; }         public string[] tags { get; set; }         public string[] categories { get; set; }         public string executivesummary { get; set; }         public hourlyrate hourlyrate { get; set; }       } 

first off documentation nest.azurewebsites.com current , applies latest release of nest 1.0.0-beta1 , elasticsearch.net. please ensure using latest version , reference blog post it: introducing elasticsearch.net , nest 1.0.0-beta1 more details.

you can exclude property in poco being indexed using .enabled() setting in fluent mapping. or alternately can use optout setting in elasticproperty attribute. (however, noticed staying away elasticproperty attributes).

please have @ fluentmappingfullexampletests.cs in nest source reference on of fluent mapping settings/options. includes boosting , boostfield.

yes, indexdescriptor 1 option mapping class fields. see create index reference, section on create index settings , mappings in 1 go fluently. alternately, can use put mapping api apply mapping index. either approach valid, prefer apply mappings @ index creation time.

hope helps.


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -