コード例 #1
0
ファイル: Searcher.cs プロジェクト: formist/LinkMe
        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);
        }
コード例 #2
0
ファイル: Sorter.cs プロジェクト: formist/LinkMe
        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);
        }