[ 
https://issues.apache.org/jira/browse/LUCENE-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647763#action_12647763
 ] 

Hoss Man commented on LUCENE-427:
---------------------------------

beyond the space overhead of maintaining a reference to the rewritten query, 
you would run into problems with extractTerms returning the terms based on 
whatever IndexReader was used the *last* time the query was rewritten ... which 
in a multi threaded environment may not be the last time you think it was 
rewritten.

and as mark said: if you're going to assume rewrite has been called, why not 
just hang on to the output of hte rewrite call yourself?

Last but not least, is the javadocs for Query.extractTerms() ...

bq. Expert: adds all terms occuring in this query to the terms set. Only works 
if this query is in its rewritten form.

as noted: the method shouldn't be called on any query unless it was the result 
of a previous rewrite() call. per that "spec" the default implementation (which 
throws UnsupportedOperationException) is the correct behavior for any concrete 
subclass of Query that doesn't "return this;" in it's rewrite() method.

> PrefixQuery.extractTerms() missing
> ----------------------------------
>
>                 Key: LUCENE-427
>                 URL: https://issues.apache.org/jira/browse/LUCENE-427
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: CVS Nightly - Specify date in submission
>         Environment: Operating System: All
> Platform: All
>            Reporter: Mikko Noromaa
>            Assignee: Lucene Developers
>            Priority: Minor
>         Attachments: PrefixQuery.diff
>
>
> RC1.9 on 2005-08-21. I will attach a patch to add my version of 
> extractTerms().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to