Include_In_Parent option for ElasticSearch and NEST library -


i using elasticsearch , nest .net library implementing search functionality needed in our app. in model, have type contains nested objects per below.

[elastictype(name = "x")] public class x {     [elasticproperty(includeinall = false, index = fieldindexoption.notanalyzed)]     public string id { get; set; }        [elasticproperty(type = fieldtype.nested)]     public list<y> ys { get; set; }    } 

any queries executed against x executed against list of ys. highlight hits in nested objects , based on https://github.com/elasticsearch/elasticsearch/issues/5245 .

however, in order use proposed workaround, include_in_parent option should true nested object.

how can option enabled using nest library? there elasticproperty property (i haven’t found obvious one) or other way so?

thank you

apparently can done using fluent syntax. above case code be:

.addmapping<x>(m => m     .properties(p => p          .nestedobject<y>(n => n              .name("ys")              .includeinparent()) 

Comments

Popular posts from this blog

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

amazon web services - When using Cognito credentials with AWS in a browser (javascript), keep getting "missing credentials" error -

c# - How to set the datatextfield value instead of the value on a drop down list? -