Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            DataSourceManager dataSourceMgr = new DataSourceManager();
            DBDataSource dbSource = new DBDataSource();
            dataSourceMgr.AddDataSource(dbSource);

            //List<DataItem> dataItemList = dbSource.GetDataItems();

            List<IFilter> filetList = new List<IFilter>();
            ContentFilter contentFilter = new ContentFilter("mail");
            filetList.Add(contentFilter);

            SimpleSearchEngine searchEngine = new SimpleSearchEngine();

            List<DataItem> results = searchEngine.Search(dataSourceMgr, filetList);

            contentFilter.Content = "mail";
        }
Exemplo n.º 2
0
        public void GetMatchingFactor_20()
        {
            DataItem dataItem = new DataItem();
            dataItem.Id = "dummyId";

            dataItem.Key = "mk";
            dataItem.Title = "mailTitle";
            dataItem.Value = "this is the value of the mail item";
            dataItem.Comments = "the comments for the mail is added here";

            dataItem.Labels = "mail;dummy";
            dataItem.AccessCounter = 2;

            ContentFilter filter = new ContentFilter("title");

            UInt32 matchingFactor = filter.GetMatchingFactor(dataItem);

            Assert.AreEqual(20, matchingFactor);
        }
Exemplo n.º 3
0
        public void Constructor()
        {
            ContentFilter filter = new ContentFilter("mail");

            Assert.AreEqual("mail", filter.Content);
        }
Exemplo n.º 4
0
        private void DoSearch(String content)
        {
            ContentFilter filter = new ContentFilter(content);
            List<IFilter> filterList = new List<IFilter>();
            filterList.Add(filter);

            mSearchResult = mSearchEngine.Search(mDsManager, filterList);
            UpdateList();
        }