コード例 #1
0
ファイル: Search.cs プロジェクト: ErezLevip/qfind
        public async Task <IEnumerable <RankedResult> > Get(string pattern, FindOptions options)
        {
            if (!string.IsNullOrEmpty(pattern))
            {
                var keys = pattern.Split(' ').Select(k => k.ToLower());
                var previousSelections = await _dbAdapter.GetAllPreviousSelections();

                var results = (await _indexer.Get(keys, options.FileNameOnly, options.ExplicitValue)).ToList();
                return(_rankedResults.Get(results, previousSelections, options.MaxResults));
            }
            return(new List <RankedResult>().AsEnumerable());
        }