java - Lucene - How to use TeeSinkTokenFilter? -


would please explain how(and for) use teesinktokenfilter, lucene? example appreciated =p. didn't find official documentation clear , , have looked many sites, without progress. thanks.

yeah, didn't think official documentation clear, either. think part of made confusing demonstrated 2 different features in way made hard tell them apart. let me see if can rewrite example show basic case.

teesinktokenfilter source1 = new teesinktokenfilter(     new whitespacetokenizer(version, reader1)); teesinktokenfilter.sinktokenstream sink1 = source1.newsinktokenstream(); teesinktokenfilter.sinktokenstream sink2 = source1.newsinktokenstream(); source1.consumealltokens(); // tokens cached @ point  tokenstream final3 = new entitydetect(sink1); tokenstream final4 = new urldetect(sink2);  d.add(new textfield("f3", final3, field.store.no)); d.add(new textfield("f4", final4, field.store.no)); 

this allows final3 , final4 token streams share processing done source1. official documentation said, order in streams consumed important, doesn't say, order appears indeterminate (or maybe alphabetical field name). recommend using consumealltokens method i've done above.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -