November Happy Hour will be moved to Thursday December 5th.

Projections not working?

Vote:
 

I am trying to use projections to minimize the amount of data that are returned from the Find server but I got this error:

Error setting value to 'Category' on 'ProductPage'

I am using code that looks like this:

var searchQuery = _searchClient.Search(Language.Swedish)
                    .Filter(f => f.Cities.In(locations, true));
                    searchQuery.Select(s => new 
                    {
                        Title = s.Title,
                        LinkUrl = s.LinkUrl
                    });

var result = searchQuery.GetResult();

Anyone got a clue on how it could be like this?

#121449
May 11, 2015 15:31
Vote:
 

Your example isn't cahined. Either you need to do:

searchQuery = searchQuery.Select(...)

or continue:

.Filter(...).Select(...)

/Henrik

#121824
May 18, 2015 15:19
Vote:
 

Thanks, I was blind......

of course it should be like that, thanks for seeing what I missed... ;-)

#121825
May 18, 2015 15:28
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.