I have a bigger document and I would like to return just 2 fields for example the suburb and the name, however, suburb is inside another object called address.
I can make it work by sending this to ES (I'm using version 1.4.5)
{
"fields": ["address.suburb", "name"]
}
However, I can't make it work on ElasticLinq.
I believe this is doable and I'm just querying it incorrectly.
If I have this classes (for example, my ES document as mentioned before is much bigger) :
public class Customer {
public string Name {get;set;}
public bool Active {get;set;}
public Address Address {get;set;}
}
public class Address {
public string Street {get;set;}
public string Suburb {get;set;}
}
How could I select it on ElasticLinq?
I've tried this and many other similar variations, but it does not generate the proper query and returns a bad request.
var result = context.Query<Customer>
.Select(x => new {Name = x.Name, Suburb = x.Address.Suburb});
I've even tried to change Address to IQueryable and select inside of it (similar to the Any examples some people use to query nested itens in the Where clause) but I couldn't make it work either.
Is this doable at all in the current version?
Cheers
I have a bigger document and I would like to return just 2 fields for example the suburb and the name, however, suburb is inside another object called address.
I can make it work by sending this to ES (I'm using version 1.4.5)
However, I can't make it work on ElasticLinq.
I believe this is doable and I'm just querying it incorrectly.
If I have this classes (for example, my ES document as mentioned before is much bigger) :
How could I select it on ElasticLinq?
I've tried this and many other similar variations, but it does not generate the proper query and returns a bad request.
I've even tried to change Address to IQueryable and select inside of it (similar to the Any examples some people use to query nested itens in the Where clause) but I couldn't make it work either.
Is this doable at all in the current version?
Cheers