r110877 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110876‎ | r110877 | r110878 >
Date:21:56, 7 February 2012
Author:oren
Status:deferred
Tags:
Comment:
to conform to Lucene 2.9.4 API:
added the method required by an api signature change
Modified paths:
  • /trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/search/CachedSearchable.java (modified) (history)

Diff [purge]

Index: trunk/lucene-search-3/src/main/java/org/wikimedia/lsearch/search/CachedSearchable.java
@@ -7,6 +7,7 @@
88 import org.apache.lucene.document.Document;
99 import org.apache.lucene.document.FieldSelector;
1010 import org.apache.lucene.index.Term;
 11+import org.apache.lucene.search.Collector;
1112 import org.apache.lucene.search.Explanation;
1213 import org.apache.lucene.search.Filter;
1314 import org.apache.lucene.search.HitCollector;
@@ -43,7 +44,7 @@
4445 this.searchable = searchable;
4546 log.debug("New cached searchable for "+searchable);
4647 }
47 -
 48+ @Override
4849 public void close() throws IOException {
4950 log.debug("called close()");
5051 try{
@@ -54,7 +55,7 @@
5556 throw new IOException(e.getMessage());
5657 }
5758 }
58 -
 59+ @Override
5960 public Document doc(int i) throws IOException {
6061 log.debug("called doc("+i+")");
6162 try{
@@ -76,7 +77,7 @@
7778 throw new IOException(e.getMessage());
7879 }
7980 }
80 -
 81+ @Override
8182 public Document[] docs(int[] i) throws IOException {
8283 log.debug("called docs("+Arrays.toString(i)+")");
8384 try{
@@ -98,7 +99,7 @@
99100 throw new IOException(e.getMessage());
100101 }
101102 }
102 -
 103+ @Override
103104 public int docFreq(Term term) throws IOException {
104105 log.debug("called docFreq("+term+")");
105106 log.warn("Should never call docFreq(Term), but docFreqs(Term[])");
@@ -111,7 +112,7 @@
112113 throw new IOException(e.getMessage());
113114 }
114115 }
115 -
 116+ @Override
116117 public int[] docFreqs(Term[] terms) throws IOException {
117118 log.debug("called docFreqs("+Arrays.toString(terms)+")");
118119 try{
@@ -122,7 +123,7 @@
123124 throw new IOException(e.getMessage());
124125 }
125126 }
126 -
 127+ @Override
127128 public Explanation explain(Weight weight, int doc) throws IOException {
128129 log.debug("called explaint("+weight+","+doc+")");
129130 try{
@@ -133,7 +134,7 @@
134135 throw new IOException(e.getMessage());
135136 }
136137 }
137 -
 138+ @Override
138139 public int maxDoc() throws IOException {
139140 try{
140141 if(maxDocCached == -1){
@@ -148,7 +149,7 @@
149150 throw new IOException(e.getMessage());
150151 }
151152 }
152 -
 153+ @Override
153154 public Query rewrite(Query query) throws IOException {
154155 log.debug("called rewrite("+query+")");
155156 try{
@@ -159,7 +160,8 @@
160161 throw new IOException(e.getMessage());
161162 }
162163 }
163 -
 164+
 165+ @Override
164166 public void search(Weight weight, Filter filter, HitCollector results) throws IOException {
165167 log.debug("called search("+weight+","+filter+","+results+")");
166168 try{
@@ -170,7 +172,23 @@
171173 throw new IOException(e.getMessage());
172174 }
173175 }
 176+
 177+ @Override
 178+ public void search(Weight weight, Filter filter, Collector collector)
 179+ throws IOException {
 180+ log.debug("called search("+weight+","+filter+","+collector+")");
 181+ try{
 182+ searchable.search(weight,filter,collector);
 183+ } catch(Exception e){
 184+ log.error(e.getMessage(), e);
 185+ SearcherCache.getInstance().reInitializeRemote(iid,host);
 186+ throw new IOException(e.getMessage());
 187+ }
 188+
 189+ }
174190
 191+
 192+ @Override
175193 public TopFieldDocs search(Weight weight, Filter filter, int n, Sort sort) throws IOException {
176194 log.debug("called search("+weight+","+filter+","+n+","+sort+")");
177195 try{
@@ -181,7 +199,7 @@
182200 throw new IOException(e.getMessage());
183201 }
184202 }
185 -
 203+ @Override
186204 public TopDocs search(Weight weight, Filter filter, int n) throws IOException {
187205 log.debug("called search("+weight+","+filter+","+n+")");
188206 try{
@@ -197,6 +215,4 @@
198216 public String toString() {
199217 return searchable.toString();
200218 }
201 -
202 -
203219 }

Status & tagging log