Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchDescriptor.Fields should (optionally) take a list of field names. #68

Closed
Morgul opened this issue Jul 30, 2012 · 2 comments
Closed

Comments

@Morgul
Copy link

Morgul commented Jul 30, 2012

I'm currently doing a very simple search with nest, but I need to limit the fields being returned. I'm declaring my search as follows:

    SearchDescriptor<dynamic> search = new SearchDescriptor<dynamic>();

This works perfectly for my needs (as making models for our returns is a big maintenance concern), however, trying to specify Fields is almost impossible to do. I've managed to get it to work by doing this:

    search.Fields(f => (new { listing_name = "" }).listing_name);

This is very difficult to work with, and while I understand that if I wasn't using dynamic this would be more straightforward, I believe the simplest solution would be to have Fields optionally take a list of field names. It's straightforward, and is the 'least surprising' way of working with the Fields parameter (imho).

@Mpdreamz
Copy link
Member

yuck, you are absolutely right. I noticed this a few weeks back but forgot to write it on my todo list.

Implemented:

f2d79d6

@Morgul
Copy link
Author

Morgul commented Jul 30, 2012

Wonderful! Exactly what I was looking for.

Amazing response time, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants