[ https://issues.apache.org/jira/browse/LUCENE-6575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589464#comment-14589464 ]
Uwe Schindler commented on LUCENE-6575: --------------------------------------- bq. 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 disagree with this. You should still give users who want to use call chaining to do this. If you don't want it you can use those methods like if they were void. >From my perspective, I have the problem that I cannot really read those chains >of {{localVar.setXXX()}} because of the redundancy. Others see this different. >But by making them to return this instead of void, you have both options. > 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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org