コード例 #1
0
ファイル: LuceneDataSource.cs プロジェクト: iEmiya/ruaddress
 public AddressPartReduction GetReduction(ParsedAddressPart part)
 {
     if (_reduction == null)
     {
         _reduction = new ReductionRamStorage(_indexDirectory);
     }
     return _reduction.Get(part.Level, part.Reduction);
 }
コード例 #2
0
ファイル: LuceneDataSource.cs プロジェクト: iEmiya/ruaddress
        public void Clear()
        {
            using (var fsDirectory = FSDirectory.Open(_indexDirectory))
            using (var writer = new IndexWriter(fsDirectory, _analyzer, true, IndexWriter.MaxFieldLength.LIMITED))
                writer.DeleteAll();

            _indexWrite = new IndexWriteRamStorage();
            _reduction = new ReductionRamStorage(_indexDirectory);
        }