private void FilterByBedrooms(IFulltextQuery <SphinxConnectorTest> sphinxQuery, Range <int> bedrooms) { if (bedrooms.From.HasValue) { sphinxQuery.Where(x => x.Bedrooms >= bedrooms.From); } if (bedrooms.To.HasValue) { sphinxQuery.Where(x => x.Bedrooms <= bedrooms.To); } }
public void FilterQuery(IFulltextQuery <SphinxConnectorTest> sphinxQuery, SearchCriteria criteria) { FilterByBedrooms(sphinxQuery, criteria.Bedrooms); }