[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-24 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14335570#comment-14335570
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1662130 from [~rjernst] in branch 'dev/branches/branch_5x'
[ https://svn.apache.org/r1662130 ]

LUCENE-6246: fix missed checks on PostingsEnum.POSITIONS (merged 1662129)

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Fix For: Trunk, 5.1

 Attachments: LUCENE-6246-flags-cleanup.patch, 
 LUCENE-6246-flags-cleanup.patch, LUCENE-6246-trunk.patch, 
 LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-24 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14335562#comment-14335562
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1662129 from [~rjernst] in branch 'dev/trunk'
[ https://svn.apache.org/r1662129 ]

LUCENE-6246: fix missed checks on PostingsEnum.POSITIONS

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Fix For: Trunk, 5.1

 Attachments: LUCENE-6246-flags-cleanup.patch, 
 LUCENE-6246-flags-cleanup.patch, LUCENE-6246-trunk.patch, 
 LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14334136#comment-14334136
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1661822 from [~rjernst] in branch 'dev/trunk'
[ https://svn.apache.org/r1661822 ]

LUCENE-6246: simplify flags for PostingsEnum

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-flags-cleanup.patch, 
 LUCENE-6246-flags-cleanup.patch, LUCENE-6246-trunk.patch, 
 LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14334186#comment-14334186
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1661829 from [~rjernst] in branch 'dev/branches/branch_5x'
[ https://svn.apache.org/r1661829 ]

LUCENE-6246: simplify flags for PostingsEnum (merged 1661822)

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-flags-cleanup.patch, 
 LUCENE-6246-flags-cleanup.patch, LUCENE-6246-trunk.patch, 
 LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-23 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14334111#comment-14334111
 ] 

Robert Muir commented on LUCENE-6246:
-

+1, thanks for cleaning up.

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-flags-cleanup.patch, 
 LUCENE-6246-flags-cleanup.patch, LUCENE-6246-trunk.patch, 
 LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-23 Thread Alan Woodward (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14334100#comment-14334100
 ] 

Alan Woodward commented on LUCENE-6246:
---

There are some changes to SimpleTextFieldsReader and TestUtil that I think you 
probably didn't mean to include?  Other than that, though, it looks splendid.  
+1!  And thanks for cleaning this up.

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-flags-cleanup.patch, 
 LUCENE-6246-trunk.patch, LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324282#comment-14324282
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1660405 from [~rcmuir] in branch 'dev/trunk'
[ https://svn.apache.org/r1660405 ]

LUCENE-6246: add simple test for postings reuse/flags/behavior (DOCS_ONLY so 
far), fix asserting to support reuse

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324440#comment-14324440
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1660441 from [~rcmuir] in branch 'dev/trunk'
[ https://svn.apache.org/r1660441 ]

LUCENE-6246: simple tests for other index/flags possibilities

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324448#comment-14324448
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1660442 from [~rcmuir] in branch 'dev/branches/branch_5x'
[ https://svn.apache.org/r1660442 ]

LUCENE-6246: simple tests for other index/flags possibilities

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324334#comment-14324334
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1660422 from [~rcmuir] in branch 'dev/branches/branch_5x'
[ https://svn.apache.org/r1660422 ]

LUCENE-6246: add simple test for postings reuse/flags/behavior (DOCS_ONLY so 
far), fix asserting to support reuse

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324169#comment-14324169
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1660375 from [~rcmuir] in branch 'dev/branches/branch_5x'
[ https://svn.apache.org/r1660375 ]

LUCENE-6246: Fix DocsEnum - PostingsEnum transition (phase 1)

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread Michael McCandless (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324767#comment-14324767
 ] 

Michael McCandless commented on LUCENE-6246:


+1

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch, LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324817#comment-14324817
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1660489 from [~rcmuir] in branch 'dev/branches/branch_5x'
[ https://svn.apache.org/r1660489 ]

LUCENE-6246: add backwards layer

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch, LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread Ryan Ernst (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324514#comment-14324514
 ] 

Ryan Ernst commented on LUCENE-6246:


+1, great tests

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch, LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread Adrien Grand (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324601#comment-14324601
 ] 

Adrien Grand commented on LUCENE-6246:
--

+1!

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch, LUCENE-6246_backwards.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-17 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14324145#comment-14324145
 ] 

ASF subversion and git services commented on LUCENE-6246:
-

Commit 1660366 from [~rcmuir] in branch 'dev/trunk'
[ https://svn.apache.org/r1660366 ]

LUCENE-6246: Fix DocsEnum - PostingsEnum transition (phase 1)

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-14 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321270#comment-14321270
 ] 

Robert Muir commented on LUCENE-6246:
-

FLAG_ALL is also buggy today. The generated bitmask does not actually include 
offsets. It would need to be 0xF.

The logic is also wrong here for OFFSETS and PAYLOADS i think too? With the 
current constants, OFFSETS implies positions but PAYLOADS does not. This 
doesn't make sense...

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir

 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-14 Thread Michael McCandless (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321312#comment-14321312
 ] 

Michael McCandless commented on LUCENE-6246:


+1 to the plan and to the trunk patch.

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-14 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321415#comment-14321415
 ] 

Robert Muir commented on LUCENE-6246:
-

Thanks for reviewing. Anyone else please have a look if you have the chance. 

There is a fair amount of work to do on this issue, but I will do it. I just 
want to do it iteratively.

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-14 Thread Ryan Ernst (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321614#comment-14321614
 ] 

Ryan Ernst commented on LUCENE-6246:


+1 The trunk patch and plan also lgtm. 

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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



[jira] [Commented] (LUCENE-6246) Fix DocsEnum - PostingsEnum transition

2015-02-14 Thread Alan Woodward (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-6246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14321685#comment-14321685
 ] 

Alan Woodward commented on LUCENE-6246:
---

+1, thanks Rob, this makes the transition much cleaner

 Fix DocsEnum - PostingsEnum transition
 ---

 Key: LUCENE-6246
 URL: https://issues.apache.org/jira/browse/LUCENE-6246
 Project: Lucene - Core
  Issue Type: Bug
Reporter: Robert Muir
 Attachments: LUCENE-6246-trunk.patch


 The current back compat introduced in LUCENE-4524, does not really help the 
 users calling e.g. LeafReader.termDocsEnum() or 
 LeafReader.termPositionsEnum(), because the former's return value changes to 
 PostingsEnum, its superclass, and the latter got removed.
 It also does not help users using TermsEnum.docs() or 
 TermsEnum.docsAndPositions() which got removed and just replaced with 
 postings().
 DocsEnum is different, but not deprecated, instead only used by some codecs 
 as a convenience class. DocsAndPositionsEnum is removed.
 I think we can do this a little better. First, we need to fix trunk to work 
 the way we want it to look. I think we should have LeafReader.postings() and 
 TermsEnum.postings(), and everything should use PostingsEnum. This is 
 simplest.
 But in 5.x, I think we should have DocsEnum and DocsAndPositionsEnum which 
 are deprecated, to help guide the user.
 The sugar methods on LeafReader that exist in 5.0 (termDocsEnum(), 
 termPositionsEnum()) should be deprecated (with message to use postings()) 
 and final, and can just wrap PostingsEnum. There is no reuse and flags here 
 so this is very simple.
 On TermsEnum its more complicated, but i dont think impossible. We should add 
 back deprecated and final termDocsEnum() and termPositionsEnum() (with 
 message to use postings()) and these deprecated ones can have an instanceof 
 check, unwrapping back to PostingsEnum before they invoke postings behind the 
 scenes. 
 For the 2 remaining ones on TermsEnum that take flags, thats the most tricky. 
 I actually think we shouldn't change the existing constant values when we 
 dont have to. And I don't think the names FLAG_FREQS are special, i'd rather 
 these just be constants like FREQS. I looked thru JDK constants 
 (http://docs.oracle.com/javase/7/docs/api/constant-values.html) and only one 
 class uses this FLAG_xxx prefix. 
 So I think we should have PostingsEnum.FREQS etc with new values, not 
 conflicting with the old FLAG_FREQS etc values (which we can add back, 
 deprecated, to DocsEnum and DocsAndPositionsEnum). We can even add a check to 
 the deprecated methods that only valid values are passed.
 This just means we have contained back compat, only for deprecated and final 
 sugar methods in LeafReader and TermsEnum, and the 2 deprecated classes. I 
 think we can live with that and it would save users pain.



--
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