Below is the query and index I have for retrieving fixtures for a given team (home or away). However the where clause is being completely ignored. How can I do this?Query:var teamResults = session.Query<FixtureTeams, Results_BySeason>().Where(result => result.HomeTeamId == teamId || result.AwayTeamId == teamId).As<FixtureTeams>().Lazily();Index:public class Results_BySeason : AbstractIndexCreationTask<Season>{public Results_BySeason(){Map = seasons => from season in seasonsfrom stage in season.Stagesfrom @group in stage.Groupsfrom fixture in @group.Fixturesselect new
{season.Idseason.CompetitionName,
GroupId = @group.Id,FixtureId = fixture.Id,fixture.HomeTeamId,fixture.AwayTeamId,fixture.HomeFullTimeScore,fixture.AwayFullTimeScore,};TransformResults = (database, seasons) => from season in seasonsfrom stage in season.Stagesfrom @group in stage.Groupsfrom fixture in @group.Fixtureslet homeTeam = database.Load<Team>("teams/" + fixture.HomeTeamId)let awayTeam = database.Load<Team>("teams/" + fixture.AwayTeamId)select new {season.Id,season.CompetitionId,season.CompetitionName,fixture.ResultType,GroupId = @group.Id,FixtureId = fixture.Id,fixture.HomeTeamId,fixture.AwayTeamId,fixture.HomeFullTimeScore,fixture.AwayFullTimeScore,HomeTeamName = homeTeam.Name,AwayTeamName = awayTeam.Name};}}
The transform results happens on the server at query time. Is that what you mean by lazy?
Map and reduce happen at index time.