Beispiel #1
0
        public override void Index(IndexingOptions options)
        {
            throw new NotImplementedException();

            /*
             *  var directory = LuceneStore.FSDirectory.Open(target);
             *
             *  //var analyzer = new Lucene.Net.Analysis.Es.SpanishAnalyzer(LuceneUtil.LuceneVersion.LUCENE_48);
             *  //var analyzer = new Lucene.Net.Analysis.Standard.StandardAnalyzer(LuceneUtil.LuceneVersion.LUCENE_48);
             *  var analyzer = new WhitespaceAnalyzer(LuceneUtil.LuceneVersion.LUCENE_48);
             *
             *  Console.WriteLine("Indexing to directory '" + target + "'...");
             *
             *  var files = (
             *      from string ext in _extensionList
             *      from file in Directory.GetFiles(folder, ext, SearchOption.AllDirectories)
             *      where !file.Contains(target)
             *      select file.Replace(folder + "\\", "")
             *      ).ToList();
             *
             *  var indexConfig = new IndexWriterConfig(LuceneUtil.LuceneVersion.LUCENE_48, analyzer);
             *
             *  using (var writer = new IndexWriter(directory, indexConfig))
             *  {
             *      IndexFileList(writer, files, folder);
             *  }
             */
        }
Beispiel #2
0
        private void VerifyIndexExists(IndexingOptions options)
        {
            _indexFilename = Path.Combine(_rootFolder, ".manualindex");
            if (options.RecreateIndex)
            {
                if (File.Exists(_indexFilename))
                {
                    File.Delete(_indexFilename);
                }
            }

            if (!File.Exists(_indexFilename))
            {
                CreateIndex();
            }
        }
Beispiel #3
0
        public override void Index(IndexingOptions options)
        {
            _rootFolder = options.Folder;

            var target = ".manualindex";

            // todo: leer fecha de modificacion de IndexInfo
            // todo: filtrar por fecha de modificacion
            var files = (
                from string ext in options.AllowedExtensions
                from file in Directory.GetFiles(options.Folder, ext, SearchOption.AllDirectories)
                where !file.Contains(target)
                select file.Replace(options.Folder + "\\", "")
                ).ToList();

            VerifyIndexExists(options);
            IndexFileList(files, options.Folder);
            UpdateIndexInfo(LATEST_INDEX_DATE, DateTime.Now.ToString("yyyyMMdd HH:mm:ss.fffff"));
        }
Beispiel #4
0
 public abstract void Index(IndexingOptions options);