Am 12.03.2013 10:39, schrieb Uwe Schindler:
> I would suggest to use my example code with the fake query and custom
> rewrite. This does not have the overhead of BooleanQuery and more important:
> You don't need to change the *global* and *static* default in BooleanQuery.
> Otherwise you could
http://www.thetaphi.de
eMail: u...@thetaphi.de
> -Original Message-
> From: Carsten Schnober [mailto:schno...@ids-mannheim.de]
> Sent: Tuesday, March 12, 2013 10:13 AM
> To: java-user@lucene.apache.org
> Subject: Re: Rewrite for RegexpQuery
>
> Am 11.03.2013 18:22,
Am 11.03.2013 18:22, schrieb Michael McCandless:
> On Mon, Mar 11, 2013 at 9:32 AM, Carsten Schnober
> wrote:
>> Am 11.03.2013 13:38, schrieb Michael McCandless:
>>> On Mon, Mar 11, 2013 at 7:08 AM, Uwe Schindler wrote:
>>>
Set the rewrite method to e.g. SCORING_BOOLEAN_QUERY_REWRITE, then t
On 03/11/2013 01:22 PM, Michael McCandless wrote:
On Mon, Mar 11, 2013 at 9:32 AM, Carsten Schnober
wrote:
Am 11.03.2013 13:38, schrieb Michael McCandless:
On Mon, Mar 11, 2013 at 7:08 AM, Uwe Schindler wrote:
Set the rewrite method to e.g. SCORING_BOOLEAN_QUERY_REWRITE,
Sent: Monday, March 11, 2013 6:41 PM
> To: java-user@lucene.apache.org
> Subject: RE: Rewrite for RegexpQuery
>
> I think we have here different problems:
>
> Carsten wants to just collect the terms a MTQ visits, so using BooleanQuery
> to do this is fine, unless you hit t
m: Michael McCandless [mailto:luc...@mikemccandless.com]
> Sent: Monday, March 11, 2013 6:23 PM
> To: java-user@lucene.apache.org
> Subject: Re: Rewrite for RegexpQuery
>
> On Mon, Mar 11, 2013 at 9:32 AM, Carsten Schnober mannheim.de> wrote:
> > Am 11.03.2013 13:38, sc
On Mon, Mar 11, 2013 at 9:32 AM, Carsten Schnober
wrote:
> Am 11.03.2013 13:38, schrieb Michael McCandless:
>> On Mon, Mar 11, 2013 at 7:08 AM, Uwe Schindler wrote:
>>
>>> Set the rewrite method to e.g. SCORING_BOOLEAN_QUERY_REWRITE, then this
>>> should work (after rewrite your query is a Boole
Am 11.03.2013 13:38, schrieb Michael McCandless:
> On Mon, Mar 11, 2013 at 7:08 AM, Uwe Schindler wrote:
>
>> Set the rewrite method to e.g. SCORING_BOOLEAN_QUERY_REWRITE, then this
>> should work (after rewrite your query is a BooleanQuery, which supports
>> extractTerms()).
>
> ... as long a
Am 11.03.2013 14:13, schrieb Uwe Schindler:
>> Regarding the application of IndexSearcher.rewrite(Query) instead: I don't
>> see a way to set the rewrite method there because the Query's rewrite
>> method does not seem to apply to IndexSearcher.rewrite().
>
> Replace:
>> BooleanQuery bq = (Boolea
> Set terms = new HashSet<>();
> MultiTermQuery query = new RegexpQuery(new Term("text", query));
> query.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_RE
> WRITE);
> BooleanQuery bq = (BooleanQuery) query.rewrite(reader);
> bq.extractTerms(terms);
>
>
> Regarding the application of Index
On Mon, Mar 11, 2013 at 7:08 AM, Uwe Schindler wrote:
> Set the rewrite method to e.g. SCORING_BOOLEAN_QUERY_REWRITE, then this
> should work (after rewrite your query is a BooleanQuery, which supports
> extractTerms()).
... as long as you don't exceed the max number of terms allowed by BQ
(10
Am 11.03.2013 12:08, schrieb Uwe Schindler:
> This works for this query, but in general you have to rewrite until it is
> completely rewritten: A while loop that exits when the result of the rewrite
> is identical to the original query. IndexSearcher.rewrite() does this for
> you.
>
>> 3. Wri
Hi,
> Hi,
> I'm trying to get the terms that match a certain RegexpQuery. My (naive)
> approach:
>
> 1. Create a RegexpQuery from the queryString (e.g. "abc.*"):
> Query q = new RegexpQuery(new Term("text", queryString));
>
> 2. Rewrite the Query using the IndexReader reader:
> q = q.rewrite(rea
You could call the .getTermsEnum() on the query itself, and then step
through the terms and save them?
But this method is protected ... so you could make a subclass w/ a new
method that calls it and returns it to you.
Mike McCandless
http://blog.mikemccandless.com
On Mon, Mar 11, 2013 at 6:41 A
Hi,
I'm trying to get the terms that match a certain RegexpQuery. My (naive)
approach:
1. Create a RegexpQuery from the queryString (e.g. "abc.*"):
Query q = new RegexpQuery(new Term("text", queryString));
2. Rewrite the Query using the IndexReader reader:
q = q.rewrite(reader);
3. Write the ter
15 matches
Mail list logo