Re: SpanMultiTermQueryWrapper issue in lucene 6.6.0

2017-07-06 Thread Alan Woodward
The contract to create a Weight is to repeatedly call rewrite() until the query is no longer changing, and then call createWeight - IndexSearcher.createNormalizedWeight() will do this for you. Alan Woodward www.flax.co.uk > On 6 Jul 2017, at 12:34, Ranganath B N wrote: > > Thanks Alan. Solut

RE: SpanMultiTermQueryWrapper issue in lucene 6.6.0

2017-07-06 Thread Ranganath B N
Thanks Alan. Solution works. But why should we first rewrite? -Original Message- From: Alan Woodward [mailto:a...@flax.co.uk] Sent: Thursday, July 06, 2017 4:36 PM To: java-user@lucene.apache.org Cc: Vadiraj Muradi Subject: Re: SpanMultiTermQueryWrapper issue in lucene 6.6.0 You need to

Re: SpanMultiTermQueryWrapper issue in lucene 6.6.0

2017-07-06 Thread Alan Woodward
You need to call SpanNearQuery.rewrite(), and then call createWeight() on the resulting query. Alan Woodward www.flax.co.uk > On 6 Jul 2017, at 11:54, Ranganath B N wrote: > > Hi Adrien, > > This SpanQuery spt2 will be a component of the SpanQueryarray input to > the constructor of the

RE: SpanMultiTermQueryWrapper issue in lucene 6.6.0

2017-07-06 Thread Ranganath B N
Hi Adrien, This SpanQuery spt2 will be a component of the SpanQueryarray input to the constructor of the SpanNearQuery object. Then I call SpanNearQuery.createweight() which in turn calls SpanMultiTermQueryWrapper.createweight() and the " java.lang.IllegalArgumentException: Rewrite

Re: SpanMultiTermQueryWrapper issue in lucene 6.6.0

2017-07-06 Thread Adrien Grand
What is the context of this code? Depending whether you are just trying to consume this query or building a query wrapper, you should either call searcher.createNormalizedWeight(spt2, true) instead or make sure that your query wrapper rewrites the wrapped queries. Le jeu. 6 juil. 2017 à 12:36, Ran

SpanMultiTermQueryWrapper issue in lucene 6.6.0

2017-07-06 Thread Ranganath B N
Hi, Execution of the following code snippet "RegexpQuery regquery= new RegexpQuery(new Term("text", "regul.*")); spt2 = new SpanMultiTermQueryWrapper(regquery); spt2.createWeight(searcher, true);" throws java.lang.IllegalArgumentException: Rewrite first! Can anyon

Re: DocValue update methods don't appear to throw exception if the document doesn't exist

2017-07-06 Thread Joe Ye
Thanks very much TX! Regarding "But the updates don't actually occur during the call", could you elaborate on this a bit more? So when would the actual update occur, by which I mean persisting to disk? Is there a cache of a number of docValues updates before committing to disk? If so, when happens