protected Index(Directory directory, string name, IndexDefinition indexDefinition, AbstractViewGenerator viewGenerator) { if (directory == null) { throw new ArgumentNullException("directory"); } if (name == null) { throw new ArgumentNullException("name"); } if (indexDefinition == null) { throw new ArgumentNullException("indexDefinition"); } if (viewGenerator == null) { throw new ArgumentNullException("viewGenerator"); } this.name = name; this.indexDefinition = indexDefinition; this.viewGenerator = viewGenerator; logIndexing.DebugFormat("Creating index for {0}", name); this.directory = directory; // clear any locks that are currently held // this may happen if the server crashed while // writing to the index this.directory.ClearLock("write.lock"); searcher = new CurrentIndexSearcher(new IndexSearcher(directory, true)); }
protected Index(Directory directory, string name,IndexDefinition indexDefinition) { this.name = name; this.indexDefinition = indexDefinition; log.DebugFormat("Creating index for {0}", name); this.directory = directory; searcher = new CurrentIndexSearcher { Searcher = new IndexSearcher(directory) }; }
private void RecreateSearcher() { using (searcher.Use()) { searcher.MarkForDispoal(); searcher = new CurrentIndexSearcher { Searcher = new IndexSearcher(directory, true) }; Thread.MemoryBarrier(); // force other threads to see this write } }
protected Index(Directory directory, string name, IndexDefinition indexDefinition) { this.name = name; this.indexDefinition = indexDefinition; log.DebugFormat("Creating index for {0}", name); this.directory = directory; // clear any locks that are currently held // this may happen if the server crashed while // writing to the index this.directory.ClearLock("write.lock"); searcher = new CurrentIndexSearcher { Searcher = new IndexSearcher(directory, true) }; }
protected Index(Directory directory, string name, IndexDefinition indexDefinition) { this.name = name; this.indexDefinition = indexDefinition; log.DebugFormat("Creating index for {0}", name); this.directory = directory; // clear any locks that are currently held // this may happen if the server crashed while // writing to the index this.directory.ClearLock("write.lock"); searcher = new CurrentIndexSearcher { Searcher = new IndexSearcher(directory, true) }; }
private void RecreateSearcher() { IndexSearcher _; using (searcher.Use(out _)) { searcher.MarkForDispoal(); if (indexWriter == null) { searcher = new CurrentIndexSearcher(new IndexSearcher(directory, true)); } else { searcher = new CurrentIndexSearcher(new IndexSearcher(indexWriter.GetReader())); } Thread.MemoryBarrier(); // force other threads to see this write } }
protected Index(Directory directory, string name, IndexDefinition indexDefinition, AbstractViewGenerator viewGenerator) { if (directory == null) throw new ArgumentNullException("directory"); if (name == null) throw new ArgumentNullException("name"); if (indexDefinition == null) throw new ArgumentNullException("indexDefinition"); if (viewGenerator == null) throw new ArgumentNullException("viewGenerator"); this.name = name; this.indexDefinition = indexDefinition; this.viewGenerator = viewGenerator; logIndexing.DebugFormat("Creating index for {0}", name); this.directory = directory; // clear any locks that are currently held // this may happen if the server crashed while // writing to the index this.directory.ClearLock("write.lock"); searcher = new CurrentIndexSearcher(new IndexSearcher(directory, true)); }
public CleanUp(CurrentIndexSearcher parent) { this.parent = parent; }
public CleanUp(CurrentIndexSearcher parent) { this.parent = parent; }
private void RecreateSearcher() { using (searcher.Use()) { searcher.MarkForDispoal(); searcher = new CurrentIndexSearcher { Searcher = new IndexSearcher(directory, true) }; Thread.MemoryBarrier(); // force other threads to see this write } }
private void RecreateSearcher() { IndexSearcher _; using (searcher.Use(out _)) { searcher.MarkForDispoal(); if (indexWriter == null) { searcher = new CurrentIndexSearcher(new IndexSearcher(directory, true)); } else { searcher = new CurrentIndexSearcher(new IndexSearcher(indexWriter.GetReader())); } Thread.MemoryBarrier(); // force other threads to see this write } }