public void TestIfQueryParsesToEmptySearchTerm()
        {
            var description = new SandoQueryParser().Parse("g_u16ActiveFault");
            var builder     = CriteriaBuilder.GetBuilder().AddFromDescription(description);
            var simple      = builder.GetCriteria() as SimpleSearchCriteria;

            Assert.IsFalse(simple.SearchTerms.Where(x => String.IsNullOrWhiteSpace(x)).ToList().Count >= 1);
        }
        public virtual List <CodeSearchResult> Search(string searchString, bool rerunWithWildcardIfNoResults = false)
        {
            Contract.Requires(String.IsNullOrWhiteSpace(searchString), "CodeSearcher:Search - searchString cannot be null or an empty string!");

            var searchCriteria = CriteriaBuilder.GetBuilder().AddSearchString(searchString).GetCriteria();

            return(Search(searchCriteria, rerunWithWildcardIfNoResults));
        }
Example #3
0
        private SearchCriteria GetCriteria(string searchString, SimpleSearchCriteria searchCriteria = null)
        {
            var sandoOptions = ServiceLocator.Resolve <ISandoOptionsProvider>().GetSandoOptions();
            var description  = new SandoQueryParser().Parse(searchString);
            var builder      = CriteriaBuilder.GetBuilder().
                               AddCriteria(searchCriteria).
                               NumResults(sandoOptions.NumberOfSearchResultsReturned).AddFromDescription(description);
            var simple = builder.GetCriteria() as SimpleSearchCriteria;

            SearchCriteriaReformer.ReformSearchCriteria(simple);
            return(simple);
        }