public ArticleInfo GetAllTerms()
        {
            var files = FileHelper.GetFilesFromRelativePath(inputDirectoryName);
            string DirecotryPath = outputDirectoryName == null
            ? Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)
            : Path.GetDirectoryName(outputDirectoryName);

            var dir = FSDirectory.Open(DirecotryPath);
            IndexReader reader = DirectoryReader.Open(dir, true);
            List<string> terms = new List<string>();
            List<int> freqs = new List<int>();
            for (int i = 0; i < files.Count; i++)
            {
                var y = reader.GetTermFreqVector(i, "content");
                terms.AddRange(y.GetTerms().ToList());
                freqs.AddRange(y.GetTermFrequencies().ToList());
            }

            ArticleInfo article = new ArticleInfo();
            article.Terms = terms;
            article.FileInfo = new FileInfo("wszystkie pliki");
            article.TermsFrequency = new Dictionary<string, int>();
            for (int i = 0; i < terms.Count; i++)
            {
                if (article.TermsFrequency.ContainsKey(terms[i]))
                {
                    article.TermsFrequency[terms[i]] += freqs[i];
                }
                else
                {
                    article.TermsFrequency.Add(terms[i], freqs[i]);
                }
            }
            return article;
        }
        public List<ArticleInfo> SearchForString(string stringQuery)
        {
            var files = FileHelper.GetFilesFromRelativePath(inputDirectoryName);
            string DirecotryPath = outputDirectoryName == null
            ? Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)
            : Path.GetDirectoryName(outputDirectoryName);
            var dir = FSDirectory.Open(DirecotryPath);

            IndexReader reader = DirectoryReader.Open(dir, true);
            IndexSearcher indexSearcher = new IndexSearcher(reader);

            Analyzer analyzer = new TermAnalyzer();
            QueryParser queryParser = new QueryParser(Version.LUCENE_30, "content", analyzer);
            Query query = queryParser.Parse(stringQuery);
            Stopwatch searchStopwatch = new Stopwatch();
            searchStopwatch.Start();
            var hits = indexSearcher.Search(query, null, 100000);
            searchStopwatch.Stop();
            this.LuceneTime = searchStopwatch.Elapsed;
            List<ArticleInfo> articles = new List<ArticleInfo>();
            hits.ScoreDocs.ToList().ForEach(s =>
            {
                var y = reader.GetTermFreqVector(s.Doc, "content");
                ArticleInfo info = new ArticleInfo()
                {
                    FileInfo = files[s.Doc],
                    Rank = s.Score,
                    //Terms =  y.GetTerms().ToList()
                };

                articles.Add(info);
            });

            return articles;
        }