Index: branches/lucene-search-2.1/src/org/wikimedia/lsearch/interoperability/RMIMessengerClient.java |
— | — | @@ -246,7 +246,7 @@ |
247 | 247 | return r.getTerms(dbrole,wildcard,exactCase); |
248 | 248 | } catch(Exception e){ |
249 | 249 | recheckRemote(dbrole,host); |
250 | | - e.printStackTrace(); |
| 250 | + log.warn("Exception getting terms for wildcard="+wildcard+" on host="+host, e); |
251 | 251 | return new ArrayList<String>(); |
252 | 252 | } |
253 | 253 | } |
— | — | @@ -256,8 +256,8 @@ |
257 | 257 | RMIMessenger r = messengerFromCache(host); |
258 | 258 | return r.highlight(hits,dbrole,terms,df,maxDoc,words,exactCase,sortByPhrases,alwaysIncludeFirst); |
259 | 259 | } catch(Exception e){ |
260 | | - recheckRemote(dbrole,host); |
261 | | - e.printStackTrace(); |
| 260 | + log.warn("Exception highligthing words="+words+" on host="+host, e); |
| 261 | + recheckRemote(dbrole,host); |
262 | 262 | return new Highlight.ResultSet(new HashMap<String,HighlightResult>(),new HashSet<String>(),new HashSet<String>(),false,0,new HashSet<String>(),false); |
263 | 263 | } |
264 | 264 | } |
— | — | @@ -271,7 +271,6 @@ |
272 | 272 | log.warn("Cannot find title host for "+dbrole,e); |
273 | 273 | return new SearchResults(); |
274 | 274 | } |
275 | | - e.printStackTrace(); |
276 | 275 | recheckRemote(dbrole,host); |
277 | 276 | SearchResults res = new SearchResults(); |
278 | 277 | res.setErrorMsg("Error searching titles: "+e.getMessage()); |
Index: branches/lucene-search-2.1/src/org/wikimedia/lsearch/search/SearchEngine.java |
— | — | @@ -920,6 +920,8 @@ |
921 | 921 | logRequest(iid,"search",searchterm, q, numhits, searchStart, s); |
922 | 922 | |
923 | 923 | int size = min(limit+offset,MAXOFFSET,numhits) - offset; |
| 924 | + if( size < 0 ) |
| 925 | + size = 0; |
924 | 926 | int[] docids = new int[size]; |
925 | 927 | float[] scores = new float[size]; |
926 | 928 | // fetch documents |
Index: branches/lucene-search-2.1/src/org/wikimedia/lsearch/highlight/Highlight.java |
— | — | @@ -658,7 +658,7 @@ |
659 | 659 | phraseScore = phraseWeight; |
660 | 660 | phraseStart = phraseIndex; |
661 | 661 | phraseCount = 1; |
662 | | - } else if(inx != null && lastInx != null){ |
| 662 | + } else if(inx != null && lastInx != null && phraseStart != -1){ |
663 | 663 | if(lastInx + 1 != inx){ |
664 | 664 | // end of last phrase, begin of new |
665 | 665 | addToScore(fs,boostPhrase(phraseScore,phraseCount),phraseStart,phraseIndex,phraseCount); |