Mercurial Hosting > luan
comparison lucene/src/luan/modules/lucene/LuceneSearcher.java @ 291:a35d1177bbf0
implement Ab_testing.web_page()
git-svn-id: https://luan-java.googlecode.com/svn/trunk@292 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Tue, 09 Dec 2014 23:24:07 +0000 |
parents | 4d53e9fc1bd9 |
children | 899253043270 |
comparison
equal
deleted
inserted
replaced
290:9a0cc6d9b27b | 291:a35d1177bbf0 |
---|---|
63 return LuanFunction.NOTHING; | 63 return LuanFunction.NOTHING; |
64 } | 64 } |
65 }; | 65 }; |
66 | 66 |
67 private static abstract class MyCollector extends Collector { | 67 private static abstract class MyCollector extends Collector { |
68 int docBase; | |
69 | |
68 @Override public void setScorer(Scorer scorer) {} | 70 @Override public void setScorer(Scorer scorer) {} |
69 @Override public void setNextReader(AtomicReaderContext context) {} | 71 @Override public void setNextReader(AtomicReaderContext context) { |
72 this.docBase = context.docBase; | |
73 } | |
70 @Override public boolean acceptsDocsOutOfOrder() { | 74 @Override public boolean acceptsDocsOutOfOrder() { |
71 return true; | 75 return true; |
72 } | 76 } |
73 } | 77 } |
74 | 78 |
76 if( nObj instanceof LuanFunction ) { | 80 if( nObj instanceof LuanFunction ) { |
77 final LuanFunction fn = (LuanFunction)nObj; | 81 final LuanFunction fn = (LuanFunction)nObj; |
78 Collector col = new MyCollector() { | 82 Collector col = new MyCollector() { |
79 @Override public void collect(int doc) { | 83 @Override public void collect(int doc) { |
80 try { | 84 try { |
81 LuanTable docTbl = doc(luan,doc); | 85 LuanTable docTbl = doc(luan,docBase+doc); |
82 luan.call(fn,new Object[]{docTbl}); | 86 luan.call(fn,new Object[]{docTbl}); |
83 } catch(LuanException e) { | 87 } catch(LuanException e) { |
84 throw new LuanRuntimeException(e); | 88 throw new LuanRuntimeException(e); |
85 } catch(IOException e) { | 89 } catch(IOException e) { |
86 throw new LuanRuntimeException(luan.exception(e)); | 90 throw new LuanRuntimeException(luan.exception(e)); |