Ejemplo n.º 1
0
        public JobAdSearchResults Search(LuceneQuery query, LuceneFilter filter, IEnumerable <BrowseSelection> selections, SortField[] sorts, int skip, int take, bool includeFacets)
        {
            var request = CreateRequest(query, filter, selections, sorts, skip, take, includeFacets);
            var result  = _browser.browse(request);

            return(GetSearchResults(result, skip, take));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        protected SalaryFieldHandler(string minFieldName, string maxFieldName, IBooster booster)
        {
            _minFieldName = minFieldName;
            _maxFieldName = maxFieldName;
            _booster      = booster;

            _nullSalaryFilter = NumericRangeFilter.newIntRange(_maxFieldName, new java.lang.Integer(0), new java.lang.Integer(0), true, true);

            // nonNullSalary <=> NOT nullSalary

            _nonNullSalaryFilter = new BooleanFilter();
            _nonNullSalaryFilter.add(new FilterClause(_nullSalaryFilter, BooleanClause.Occur.MUST_NOT));
        }