lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shay Banon <kim...@gmail.com>
Subject MoreLikeThis: fieldNames and Query
Date Sat, 13 Feb 2010 23:35:39 GMT
Hi,

  I have a few questions regarding more like this:

1. In MoreLikeThis, it seems like the check for fieldNames being null and
fetching them from the reader is not done for all the like methods. For
example, it does not look like it is done at all for like(Reader r), and on
the other hand, it is done for like(File f).

2. In MoreLikeThisQuery rewrite method, there is an unnecessary conversion
to bytes and back to string. I think this:

        BooleanQuery bq= (BooleanQuery) mlt.like(new
ByteArrayInputStream(likeText.getBytes()));

should be replaced with:

        BooleanQuery bq= (BooleanQuery) mlt.like(new
StringReader(likeText));

What do you think?
-shay.banon

Mime
View raw message