CachingTokenFilter tests fail when using MockTokenizer

2015-03-23 Thread Spyros Kapnissis
Hello,  We have a couple of custom token filters that use CachingTokenFilter internally. However, when we try to test them with MockTokenizer so that we can have these nice TokenStream API checks that it provides, the tests fail with: "java.lang.AssertionError: end() called before incrementToken

Re: CachingTokenFilter tests fail when using MockTokenizer

2015-03-23 Thread Spyros Kapnissis
) returns false". Spyros On Monday, March 23, 2015 9:12 PM, Ahmet Arslan wrote: Hi Spyros, Not 100% sure but I think you should override reset method. @Override public void reset() throws IOException { super.reset(); cachedInput = null; } Ahmet On Monday, March 23, 2015 1:29

Re: CachingTokenFilter tests fail when using MockTokenizer

2015-03-24 Thread Spyros Kapnissis
://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Spyros Kapnissis [mailto:ska...@yahoo.com.INVALID] > Sent: Monday, March 23, 2015 11:02 PM > To: java-user@lucene.apache.org; Ahmet Arslan > Subject: Re: CachingTokenFilter tests fail when using MockTokenizer &

BooleanQuery rewrite optimization

2016-08-08 Thread Spyros Kapnissis
Hello all, I noticed while debugging a query that BooleanQuery will rewrite itself to remove FILTER clauses that are also MUST as an optimization/simplification, which makes total sense. So (+f:x #f:x) will become (+f:x). However, shouldn't there also be another optimization to remove FILTER clau

Re: BooleanQuery rewrite optimization

2016-08-08 Thread Spyros Kapnissis
Hm, I hadn't really thought about the minShouldMatch part, I thought it' d be covered but I see your point being semantically different if you keep it as is. However.. Running your edge case example on an actual local index I get the following: "(X X Y #X)" w/minshouldmatch=2 vs. (+X X Y) w/minsh

Re: BooleanQuery rewrite optimization

2016-08-13 Thread Spyros Kapnissis
hes to simplify boolean queries at rewrite time are welcome! Le mar. 9 août 2016 à 00:47, Spyros Kapnissis a écrit : > Hm, I hadn't really thought about the minShouldMatch part, I thought it' d > be covered but I see your point being semantically different if you keep it > as is.

Re: BooleanQuery rewrite optimization

2016-08-14 Thread Spyros Kapnissis
2016 à 12:21, Spyros Kapnissis a écrit : > Ok, I had some time to look a bit further into it. It seems that indeed a > SHOULD clause with FILTER is equivalent with an AND clause with a > minShouldMatch of -1 in terms of both the number of results and score. > My reasoning goes like th

Strange lucene parser result in boosted query with decimal in exponential form

2019-09-03 Thread Spyros Kapnissis
Hello all! We discovered an issue while testing, where some infrequent queries would return really strange results. We use a client-side formula to auto generate boost queries for some fields based on some external weights. It turns out that these external weights, if really small, they might tak