Index: branches/lucene-search-2.1/src/org/wikimedia/lsearch/ranks/Links.java |
— | — | @@ -255,14 +255,19 @@ |
256 | 256 | for(IndexUpdateRecord rec : records){ |
257 | 257 | if(rec.doDelete()){ |
258 | 258 | Article a = rec.getArticle(); |
| 259 | + String articleKey = null; |
259 | 260 | if(a.getTitle()==null || a.getTitle().equals("")){ |
260 | 261 | // try to fetch ns:title so we can have nicer debug info |
261 | 262 | String key = getKeyFromPageId(rec.getIndexKey()); |
262 | 263 | if(key != null) |
263 | 264 | a.setNsTitleKey(key); |
264 | | - } |
| 265 | + } else |
| 266 | + articleKey = a.getNsTitleKey(); |
265 | 267 | log.debug(iid+": Deleting "+a); |
266 | 268 | reader.deleteDocuments(new Term("article_pageid",rec.getIndexKey())); |
| 269 | + |
| 270 | + if( articleKey != null ) // if not a deletion be sure to cleanup funky stuff when moving over redirects, etc.. |
| 271 | + reader.deleteDocuments(new Term("article_key", articleKey)); |
267 | 272 | } |
268 | 273 | } |
269 | 274 | flush(); |