class CrescentSearchRequestWrapper {

	public Filter getFilter() throws CrescentInvalidRequestException {
		String filterQueryString = searchRequest.getFilter();
		
		if(filterQueryString != null && filterQueryString.length() > 0) {
			CustomQueryStringParser queryParser = new CustomQueryStringParser();
			
			try {
				
				Query query = queryParser.getQuery(getIndexedFields(), filterQueryString, collection.getSearchModeAnalyzer(), searchRequest.getRegexQuery());
			
				Filter filter = new QueryWrapperFilter(query);
				
				return filter;
				
			} catch (Exception e) {
				logger.error("Error In getFilter ", e);
				throw new CrescentInvalidRequestException(e.getMessage());
			}
			
		} else {
			
			return null;
		
		}
	}

	public  CrescentSearchRequestWrapper(SearchRequest searchRequest);

}