private static BrowseRequest CreateRequest(LuceneQuery query, LuceneFilter filter, IEnumerable <BrowseSelection> selections, SortField[] sorts, int skip, int take, bool includeFacets) { var request = new BrowseRequest(); request.setQuery(query); request.setFilter(filter); if (selections != null) { foreach (var selection in selections) { request.addSelection(selection); } } if (sorts != null) { request.setSort(sorts); } request.setOffset(0); request.setCount(skip + take); if (includeFacets) { request.setFacetSpec(FieldName.Industries, CreateFacetSpec()); request.setFacetSpec(FieldName.JobTypes, CreateFacetSpec()); } return(request); }
private static BrowseRequest CreateRequest(Filter filter, SortField[] sorts, int skip, int take) { var request = new BrowseRequest(); request.setFilter(filter); if (sorts != null) { request.setSort(sorts); } request.setOffset(0); request.setCount(skip + take); return(request); }