[
https://issues.apache.org/jira/browse/LUCENE-6575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589423#comment-14589423
]
Adrien Grand commented on LUCENE-6575:
--------------------------------------
Thanks for the patch. I like providing providing the field in the constructor
and then adding terms better. I have some questions:
- could you change the setters back to void so that they can't be chained, see
https://issues.apache.org/jira/browse/LUCENE-6531?focusedCommentId=14577421&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14577421
- I don't like the two Builder(Term[]) and Builder(Term[], int[])
constructors. In my opinion they defeat the point of the builder which is to
build the query step by step instead of all at once, can we remove them? They
seem to be used only in very few places, could we fix the consumers of these
constructors to use the builder API instead?
> 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
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]