Changeset 32609 for main/trunk/greenstone2/common-src/indexers/lucene-gs/src/org/greenstone/LuceneWrapper4/GS2LuceneQuery.java
- Timestamp:
- 2018-11-16T17:19:53+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/common-src/indexers/lucene-gs/src/org/greenstone/LuceneWrapper4/GS2LuceneQuery.java
r32509 r32609 105 105 } 106 106 107 try { 107 try { 108 109 if(reader != null) { 110 reader.close(); 111 searcher = null; 112 } 113 108 114 Directory full_indexdir_dir = FSDirectory.open(new File(full_indexdir)); 109 115 110 116 reader = DirectoryReader.open(full_indexdir_dir); // Returns a IndexReader reading the index in the given Directory. now readOnly=true by default, and therefore also for searcher 111 117 searcher = new IndexSearcher(reader); // during searcher.search() will get it to compute ranks when sorting by fields 112 118 113 119 this.sorter = new Sort(new SortField(this.sort_field, this.sort_type, this.reverse_sort)); 114 120 } … … 351 357 // No other methods should be called after this has been called. 352 358 } 359 353 360 } catch (IOException exception) { 354 361 exception.printStackTrace(); … … 661 668 662 669 if (!queryer.initialise()) { 670 queryer.cleanUp(); // will close reader object IF reader was instantiated 663 671 return; 664 672 } … … 683 691 } 684 692 } 685 693 queryer.cleanUp(); 686 694 } 687 695 catch (IOException exception) {
Note:
See TracChangeset
for help on using the changeset viewer.