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

Adrien Grand commented on LUCENE-6575:
--------------------------------------

Thanks for the new patch.

PhraseQuery.Builder(PhraseQuery) still feels to me like it doesn't belong to 
the PhraseQuery API. I was just looking at the call sites and noticed that this 
method was only used by query parsers, so maybe you could remove this 
PhraseQuery.Builder constructor and make it a utility method either in the 
QueryBuilder class or in some utility class in the lucene/queryparser module?

bq.  I notice that you change the constructors of BooleanQuery to private so 
can we do same thing with PhraseQuery in LUCENE-6575? We can remove a lot of 
code there :D

(Comment from LUCENE-6570) Agreed, I had added these constructors because I was 
a bit frustrated that creating very simple phrase queries was so hard, but with 
your changes it should be easy now so +1 on removing the "sugar" public 
constructors from PhraseQuery!

Also can you run "ant precommit" on your patch, I suspect it will complain 
about some missing javadocs.

> Improve API of PhraseQuery.Builder
> ----------------------------------
>
>                 Key: LUCENE-6575
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6575
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Cao Manh Dat
>            Priority: Minor
>         Attachments: LUCENE-6575.patch, LUCENE-6575.patch, LUCENE-6575.patch
>
>
> From LUCENE-6531
> In current PhraseQuery.Builder API. User must retype field again and again :
> {code}
> PhraseQuery.Builder builder = new PhraseQuery.Builder();
> builder.add(new Term("lyrics", "when"), 1);
> builder.add(new Term("lyrics", "believe"), 3);
> {code}
> Cleaner API :
> {code}
> PhraseQuery.Builder builder = new PhraseQuery.Builder("lyrics");
> builder.add("when", 1);
> builder.add("believe", 3);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to