Knut Anders Hatlen wrote: > Lubos Kosco <Lubos.Kosco at Sun.COM> writes: > > >> Knut Anders Hatlen wrote: >> >>> Lubos Kosco <Lubos.Kosco at Sun.COM> writes: >>> >>> >>> >>>> Hi all >>>> >>>> I started an attempt to upgrade lucene to 3.0.0 >>>> and fix http://defect.opensolaris.org/bz/show_bug.cgi?id=13364 >>>> >>>> if someone could review, it would be great >>>> >>>> >>> Where can I find the patches? >>> >>> >>> >> :) whooops, someone forgot to attach the link to cr, here it is: >> http://cr.opensolaris.org/~taz/webrev-2010-01-12-lucene3_0_0_and_bug13364/ >> > > Thanks! > > I don't know much about Lucene, so I cannot say whether the changes are > correct, but at least they look sensible to me. > > Apart from what J?rgen already commented, I noticed this: > > 1) There's code in many classes that's rewritten from > reusableToken.reinit(x,0,0) to termAtt.setTermBuffer(x). Does this mean > that the current code copies an empty string into the buffer (because > both start and end offset are 0), and the new code copies the entire > string (because no offset/length is specified)? If so, is that change > intended? >
that works slightly different Token.reinit(String,start,end) returns a Token with the string, which has no offset attributes in excerpt of the text, meaning you just work with the string token, but cannot position it e.g. when you have a path, you just need parts of the path, you don't care where in the text the path is and just put it into index in other parts of code that take care of positioning to create proper summary which one sees after he searches from main page you need the position hence the offsetAtt are properly filled in and the search screen happily shows where the search string in text was found - there is a plugin to lucene called Highlighter, which can make us above easier and save us the offsetAtt filling in if I grok the code properly ... so basically reinit(x,0,0) does the same as setTermBufer(x,0,x.length()) (which is the same as setTermBuffer(x) ) and then offsetAtt(0,0), which I skipped, since we don't use the positions there anyway, so no need to use offsetAtt here and set it to 0,0 ... > 2) In PathTokenizer.java, the new field adot should be final static (and > be written in upper case) > will do > 3) Change the fixme comments to say FIXME, so that they appear in > NetBeans's task list > > will do, hudson shows fixme too, so I was looking mainly at hudson, but will change it to upper case to have it shown in NB too ... thnx Lubos