Changeset 347
- Timestamp:
- 04/20/08 01:43:58 (7 months ago)
- Location:
- trunk/thrudex/src
- Files:
-
- 2 modified
-
CLuceneIndex.cpp (modified) (4 diffs)
-
CLuceneIndex.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thrudex/src/CLuceneIndex.cpp
r344 r347 169 169 modifier->flush(); 170 170 171 172 171 ram_searcher.reset(); 173 172 … … 186 185 187 186 if(syncing){ 188 ram_prev_searcher.reset(new IndexSearcher( ram_prev_directory.get() )); 187 //make a copy of the ram dir since its not thread safe 188 ram_readonly_prev_directory = shared_ptr<CLuceneRAMDirectory>(new CLuceneRAMDirectory( ram_prev_directory.get() )); 189 ram_readonly_prev_directory->__cl_addref(); //trick clucene's lame ref counters 190 191 192 ram_prev_searcher.reset(new IndexSearcher( ram_readonly_prev_directory.get() )); 189 193 searchers[2] = ram_prev_searcher.get(); 190 194 searchers[3] = NULL; … … 309 313 shared_ptr<CLuceneRAMDirectory> l_ram_readonly_directory; 310 314 shared_ptr<CLuceneRAMDirectory> l_ram_directory; 315 shared_ptr<CLuceneRAMDirectory> l_ram_readonly_prev_directory; 311 316 shared_ptr<CLuceneRAMDirectory> l_ram_prev_directory; 312 317 shared_ptr<IndexSearcher> l_ram_searcher; … … 324 329 //making sure references to underlying objects stay above 0 325 330 //for the duration of this function 326 l_ram_readonly_directory = ram_readonly_directory; 327 l_ram_directory = ram_directory; 328 l_ram_prev_directory = ram_prev_directory; 329 l_ram_searcher = ram_searcher; 330 l_ram_prev_searcher = ram_prev_searcher; 331 l_disk_searcher = disk_searcher; 331 l_ram_readonly_directory = ram_readonly_directory; 332 l_ram_directory = ram_directory; 333 l_ram_readonly_prev_directory = ram_readonly_prev_directory; 334 l_ram_prev_directory = ram_prev_directory; 335 l_ram_searcher = ram_searcher; 336 l_ram_prev_searcher = ram_prev_searcher; 337 l_disk_searcher = disk_searcher; 332 338 333 339 l_disk_filter = disk_filter; 334 340 l_disk_reader = disk_reader; 335 336 341 } 337 342 -
trunk/thrudex/src/CLuceneIndex.h
r335 r347 90 90 boost::shared_ptr<lucene::store::CLuceneRAMDirectory> ram_directory; 91 91 boost::shared_ptr<lucene::store::CLuceneRAMDirectory> ram_prev_directory; 92 boost::shared_ptr<lucene::store::CLuceneRAMDirectory> ram_readonly_prev_directory; 92 93 boost::shared_ptr<lucene::store::CLuceneRAMDirectory> ram_prev_prev_directory; 93 94 boost::shared_ptr<lucene::store::CLuceneRAMDirectory> ram_readonly_directory;
