Re: Is it necessary to create a new searcher?

2012-01-14 Thread Cheng
der within a thread, the others may be affected. With >> that, what can I do within a thread to reopen a new reader? >> > >> > >> > -- Original -- >> > From: "Ian Lea"; >> > Date: Fri, Jan 13, 2012 05:47

Re: Is it necessary to create a new searcher?

2012-01-14 Thread Cheng
I do within a thread to reopen a new reader? > > > > > > -- Original -- > > From: "Ian Lea"; > > Date: Fri, Jan 13, 2012 05:47 PM > > To: "java-user"; > > > > Subject: Re: Is it necessary to create a new

Re: Is it necessary to create a new searcher?

2012-01-13 Thread Ian Lea
ad, the others may be affected. With that, > what can I do within a thread to reopen a new reader? > > > -- Original -- > From:  "Ian Lea"; > Date:  Fri, Jan 13, 2012 05:47 PM > To:  "java-user"; > > Subject:  Re: Is it nece

Re: Is it necessary to create a new searcher?

2012-01-13 Thread dyzc2010
? -- Original -- From: "Ian Lea"; Date: Fri, Jan 13, 2012 05:47 PM To: "java-user"; Subject: Re: Is it necessary to create a new searcher? The javadocs for openIfChanged say that it returns null if not changed, so I don't think your code will work as is. You

Re: Is it necessary to create a new searcher?

2012-01-13 Thread Ian Lea
The javadocs for openIfChanged say that it returns null if not changed, so I don't think your code will work as is. You need to check the return value and you'll need to close the old reader if you have been given a new one. If you are going to be reopening if changed, there seems little point in

Is it necessary to create a new searcher?

2012-01-11 Thread Cheng
I am currently using the following statement at the end of each index writing, although I don't know if the writing modifies the indexes or not: is = new IndexSearcher(IndexReader.openIfChanged(ir)); # is -> IndexSearcher, ir-> IndexReader My question is how expensive to create a searcher insta