RE: Filtering question - solved

2015-03-19 Thread chrisbamford
Hi Uwe, Shai and Ian Thanks for your help with this - I played around with your suggestions and have got it to work perfectly. The problem was that the CachingWrapperFilter was not passing the acceptDocs through to my custom Filter, so I simply removed it. Best regards - Chris On 16.03.20

RE: Filtering question

2015-03-17 Thread chrisbamford
Hi Uwe, I guess you're probably a fed up with me and I apologise for the hassle. I realise I have asked a lot of questions in the last few days. If you get a little time could you please have a think about this problem as I am currently unable to move forward with it - I have tried all the s

RE: Filtering question

2015-03-16 Thread chrisbamford
Hi Uwe I was just composing an email to you, so here it is! You just have to implement the "protected boolean matchDoc(int docId)" method. You should return this DocIdSet from your filter instead of the manual code you created. Yes, I tried that, see below ... Sorry about earlier, I did mana

RE: Filtering question

2015-03-16 Thread Uwe Schindler
bammers.net > Subject: RE: Filtering question > > Hi Uwe > > I have downloaded Lucene 5.0.0 source to look at the Filters you mention. > DocValuesTermsFilter looks promising, however I cannot find > FieldCacheDocIdSet anywhere in Lucene 4.10.2 or in 5.0.0. Where should I be

RE: Filtering question

2015-03-16 Thread chrisbamford
Hi Uwe I have downloaded Lucene 5.0.0 source to look at the Filters you mention. DocValuesTermsFilter looks promising, however I cannot find FieldCacheDocIdSet anywhere in Lucene 4.10.2 or in 5.0.0. Where should I be looking? I take your point about brute-forcing the DocValues search and a

RE: Filtering question

2015-03-12 Thread Uwe Schindler
Hi Chris, > Hi Uwe, thanks for your suggestions. I have tried a couple of things with no > luck yet: > > > Sorry, > > I just noticed, you are using TermFilter not TermsFilter: This one > > does not support random access (using bits()). Because of this the > > filtered docs cannot be passed down

RE: Filtering question

2015-03-12 Thread chrisbamford
Hi Uwe, thanks for your suggestions. I have tried a couple of things with no luck yet: Sorry, I just noticed, you are using TermFilter not TermsFilter: This one does not support random access (using bits()). Because of this the filtered docs cannot be passed down using acceptDocs. TermsFilter

RE: Filtering question

2015-03-11 Thread Uwe Schindler
; http://www.thetaphi.de > > eMail: u...@thetaphi.de > > > > > >> -Original Message- > >> From: Uwe Schindler [mailto:u...@thetaphi.de] > >> Sent: Wednesday, March 11, 2015 8:07 PM > >> To: java-user@lucene.apache.org > >> Subject

Re: Filtering question

2015-03-11 Thread Chris Bamford
...@thetaphi.de > > >> -Original Message- >> From: Uwe Schindler [mailto:u...@thetaphi.de] >> Sent: Wednesday, March 11, 2015 8:07 PM >> To: java-user@lucene.apache.org >> Subject: RE: Filtering question >> >> Hi, >> >> BooleanQuery: >

RE: Filtering question

2015-03-11 Thread Uwe Schindler
che.org > Subject: RE: Filtering question > > Hi, > > BooleanQuery: > -- Clause 1: TermQuery > -- Clause 2: FilteredQuery > - Branch 1: MatchAllDocsQuery() > - Branch 2: MyNDVFilter > > > Why does it look like this? Clause 2 should simply b

RE: Filtering question

2015-03-11 Thread Uwe Schindler
-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Chris Bamford [mailto:ch...@chrisbamford.plus.com] > Sent: Wednesday, March 11, 2015 6:39 PM > To: java-user@lucene.apache.org > Subject: Re: Filtering question > > Additio

Re: Filtering question

2015-03-11 Thread Chris Bamford
Additional - I'm on lucene 4.10.2 If I use a BooleanFilter as per Ian's suggestion I still get a null acceptDocs being passed to my NDV filter. Sent from my iPhone > On 11 Mar 2015, at 17:19, Chris Bamford wrote: > > Hi Shai > > I thought that might be what acceptDocs was for, but in my cas

Re: Filtering question

2015-03-11 Thread Chris Bamford
Hi Shai I thought that might be what acceptDocs was for, but in my case it is null and throws a NPE if I try your suggestion. What am I doing wrong? I'd like to really understand this stuff .. Thanks Chris > On 11 Mar 2015, at 13:05, Shai Erera wrote: > > I don't see that you use acceptDo

Re: Filtering question

2015-03-11 Thread Shai Erera
I don't see that you use acceptDocs in your MyNDVFilter. I think it would return false for all userB docs, but you should confirm that. Anyway, because you use an NDV field, you can't automatically skip unrelated documents, but rather your code would look something like: for (int i = 0; i < reade

Re: Filtering question

2015-03-11 Thread Ian Lea
Can you use a BooleanFilter (or ChainedFilter in 4.x) alongside your BooleanQuery? Seems more logical and I suspect would solve the problem. Caching filters can be good too, depending on how often your data changes. See CachingWrapperFilter. -- Ian. On Tue, Mar 10, 2015 at 12:45 PM, Chris Bamf

Filtering question

2015-03-10 Thread Chris Bamford
Hi, I have an index of 30 docs, 20 of which have an owner field of "UserA" and 10 of "UserB". I also have a query which consists of: BooleanQuery: -- Clause 1: TermQuery -- Clause 2: FilteredQuery - Branch 1: MatchAllDocsQuery() - Branch 2: MyNDVFilter I execute my search as follows: s

Re: Filtering question/advice

2009-09-24 Thread Amin Mohammed-Coleman
Hi Sorry for not getting back to you. Been swamped with stuff and work and home. Just managed to check my lucene emails! You are right i made some silly mistakes with the testcase and have updated accordingly. The test is still failing but the properties are set correctly: public class Underwr

Re: Filtering question/advice

2009-09-17 Thread Chris Hostetter
FWWI: a test case with multiple asserts is more useful if you clarify where it failes ... ie: show us the failure message, or put a comment on athe line of the assert that fails. i didn't run your testcase, but skimming it a few things jumpt out at me that might explain whatever problem you ar

Re: Filtering question/advice

2009-09-09 Thread Amin Mohammed-Coleman
Hi Thanks for your reponse. Here is the following testcase: public class UnderwriterReferenceTest { private Directory directory; private Analyzer analyzer; private IndexSearcher indexSearcher; private IndexWriter indexWriter; private Document layerDocumentA; @Before

Re: Filtering question/advice

2009-09-08 Thread Chris Hostetter
: Hi : I include a testcase to show what I am trying to do. Testcase number 3 : fails. the mailing list is finicky about attachments ... the best thing to do is to include your test case directly in the body of your email as plain text. : > I created a test case to test this solution and it wo

Re: Filtering question/advice

2009-09-04 Thread Amin Mohammed-Coleman
Hi, Apologies for resending this email but just wondering if I could get some input on the below. I am in the final stages of getting a proof of concept together and this is the final piece of the puzzle. Sorry again for sending this! Cheers Amin On Fri, Sep 4, 2009 at 10:38 AM, Amin Mohammed-

Re: Filtering question/advice

2009-09-04 Thread Amin Mohammed-Coleman
Hi I include a testcase to show what I am trying to do. Testcase number 3 fails. Thanks Amin On Fri, Sep 4, 2009 at 10:17 AM, Amin Mohammed-Coleman wrote: > Hi, > > I am looking at applying a security filter for our lucene document and I > was wondering if I could get feedback on whether the so

Filtering question/advice

2009-09-04 Thread Amin Mohammed-Coleman
Hi, I am looking at applying a security filter for our lucene document and I was wondering if I could get feedback on whether the solution I have come up with. Firstly I will explain the scenario and followed by the proposed solution: We have a concept of a Layer which is a project whereby a br