public ItemSearchPresenter GetItemSearchPresenter(string itemTypeName, string itemTypeSingularLabel)
        {
            var preferenceProvider  = new PreferenceProvider(authManager.InnovatorInstance);
            var savedSearchProvider = new SavedSearchProvider(authManager.InnovatorInstance);
            var searcher            = new DefaultSearcher(authManager.InnovatorInstance, preferenceProvider, savedSearchProvider, itemTypeName, itemTypeSingularLabel);

            ItemSearchPresenter presenter = GetItemSearchPresenter(searcher);

            return(presenter);
        }
        /// <summary>
        /// Search the index
        /// </summary>
        /// <param name="query">Search query</param>
        protected void BasicSearchResult(string query)
        {
            var search = new DefaultSearcher()
                         .Search(query, 10, 1);

            rptResults.DataSource = search.Result;
            rptResults.DataBind();

            litNoOfHits.Text = "<p><strong>" + search.TotalHits.ToString() + "</strong> hits for \"" + query + "\".</p>";
        }
示例#3
0
        public void Test_Search_Span_Expect_320()
        {
            if (!Directory.EnumerateFiles(m_IndexFolder).Any())
            {
                CreateIndexOfAlice();
            }

            using (var searcher = new DefaultSearcher(m_IndexFolder))
            {
                searcher.SearchFileContent("span", 500, (resultContainer) =>
                {
                    Assert.That(resultContainer.Count(), Is.EqualTo(1));
                });
            }
        }