Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

[jira] Commented: (LUCENE-2109) Make DocsEnum subclass of DocIdSetIterator

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


jira at apache

Dec 3, 2009, 2:34 PM

Post #1 of 6 (289 views)
Permalink
[jira] Commented: (LUCENE-2109) Make DocsEnum subclass of DocIdSetIterator

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

Uwe Schindler commented on LUCENE-2109:
---------------------------------------

The DocIdSetIterator approach can be easily used for some queries or scorers as it could be e.g. directly returned by filters. A TermFilter is simply returning the DocsEnum for the specific TermRef as iterator, very simple.

> Make DocsEnum subclass of DocIdSetIterator
> ------------------------------------------
>
> Key: LUCENE-2109
> URL: https://issues.apache.org/jira/browse/LUCENE-2109
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Index
> Affects Versions: Flex Branch
> Reporter: Uwe Schindler
> Assignee: Uwe Schindler
> Fix For: Flex Branch
>
> Attachments: LUCENE-2109.patch
>
>
> Spinoff from LUCENE-1458:
> One thing I came along long time ago, but now with a new API it get's interesting again:
> DocsEnum should extend DocIdSetIterator, that would make it simplier to use and implement e.g. in MatchAllDocQuery.Scorer, FieldCacheRangeFilter and so on. You could e.g. write a filter for all documents that simply returns the docs enumeration from IndexReader.
> So it should be an abstract class that extends DocIdSetIterator. It has the same methods, only some methods must be a little bit renamed. The problem is, because java does not support multiple inheritace, we cannot also extends attributesource Would DocIdSetIterator be an interface it would work (this is one of the cases where interfaces for really simple patterns can be used, like iterators).
> The problem with multiple inheritance could be solved by an additional method attributes() that creates a new AttributeSource on first access then (because constructing an AttributeSource is costly). The same applies for the other *Enums, it should be separated for lazy init.
> DocsEnum could look like this:
> {code}
> public abstract class DocsEnum extends DocIdSetIterator {
> private AttributeSource atts = null;
> public int freq()
> public DontKnowClassName positions()
> public final AttributeSource attributes() {
> if (atts==null) atts=new AttributeSource();
> return atts;
> }
> ...default impl of the bulk access using the abstract methods from DocIdSetIterator
> }
> {code}

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Dec 4, 2009, 8:16 AM

Post #2 of 6 (257 views)
Permalink
[jira] Commented: (LUCENE-2109) Make DocsEnum subclass of DocIdSetIterator [In reply to]

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

Michael McCandless commented on LUCENE-2109:
--------------------------------------------

Looks great Uwe! I'd say commit it.

> Make DocsEnum subclass of DocIdSetIterator
> ------------------------------------------
>
> Key: LUCENE-2109
> URL: https://issues.apache.org/jira/browse/LUCENE-2109
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Index
> Affects Versions: Flex Branch
> Reporter: Uwe Schindler
> Assignee: Uwe Schindler
> Fix For: Flex Branch
>
> Attachments: LUCENE-2109.patch, LUCENE-2109.patch
>
>
> Spinoff from LUCENE-1458:
> One thing I came along long time ago, but now with a new API it get's interesting again:
> DocsEnum should extend DocIdSetIterator, that would make it simplier to use and implement e.g. in MatchAllDocQuery.Scorer, FieldCacheRangeFilter and so on. You could e.g. write a filter for all documents that simply returns the docs enumeration from IndexReader.
> So it should be an abstract class that extends DocIdSetIterator. It has the same methods, only some methods must be a little bit renamed. The problem is, because java does not support multiple inheritace, we cannot also extends attributesource Would DocIdSetIterator be an interface it would work (this is one of the cases where interfaces for really simple patterns can be used, like iterators).
> The problem with multiple inheritance could be solved by an additional method attributes() that creates a new AttributeSource on first access then (because constructing an AttributeSource is costly). The same applies for the other *Enums, it should be separated for lazy init.
> DocsEnum could look like this:
> {code}
> public abstract class DocsEnum extends DocIdSetIterator {
> private AttributeSource atts = null;
> public int freq()
> public DontKnowClassName positions()
> public final AttributeSource attributes() {
> if (atts==null) atts=new AttributeSource();
> return atts;
> }
> ...default impl of the bulk access using the abstract methods from DocIdSetIterator
> }
> {code}

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Dec 4, 2009, 10:31 AM

Post #3 of 6 (251 views)
Permalink
[jira] Commented: (LUCENE-2109) Make DocsEnum subclass of DocIdSetIterator [In reply to]

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

Uwe Schindler commented on LUCENE-2109:
---------------------------------------

OK, will do shortly after all tests are run (also contrib & bw this time).

Thanks for reviewing.

> Make DocsEnum subclass of DocIdSetIterator
> ------------------------------------------
>
> Key: LUCENE-2109
> URL: https://issues.apache.org/jira/browse/LUCENE-2109
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Index
> Affects Versions: Flex Branch
> Reporter: Uwe Schindler
> Assignee: Uwe Schindler
> Fix For: Flex Branch
>
> Attachments: LUCENE-2109.patch, LUCENE-2109.patch
>
>
> Spinoff from LUCENE-1458:
> One thing I came along long time ago, but now with a new API it get's interesting again:
> DocsEnum should extend DocIdSetIterator, that would make it simplier to use and implement e.g. in MatchAllDocQuery.Scorer, FieldCacheRangeFilter and so on. You could e.g. write a filter for all documents that simply returns the docs enumeration from IndexReader.
> So it should be an abstract class that extends DocIdSetIterator. It has the same methods, only some methods must be a little bit renamed. The problem is, because java does not support multiple inheritace, we cannot also extends attributesource Would DocIdSetIterator be an interface it would work (this is one of the cases where interfaces for really simple patterns can be used, like iterators).
> The problem with multiple inheritance could be solved by an additional method attributes() that creates a new AttributeSource on first access then (because constructing an AttributeSource is costly). The same applies for the other *Enums, it should be separated for lazy init.
> DocsEnum could look like this:
> {code}
> public abstract class DocsEnum extends DocIdSetIterator {
> private AttributeSource atts = null;
> public int freq()
> public DontKnowClassName positions()
> public final AttributeSource attributes() {
> if (atts==null) atts=new AttributeSource();
> return atts;
> }
> ...default impl of the bulk access using the abstract methods from DocIdSetIterator
> }
> {code}

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Dec 4, 2009, 12:27 PM

Post #4 of 6 (254 views)
Permalink
[jira] Commented: (LUCENE-2109) Make DocsEnum subclass of DocIdSetIterator [In reply to]

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

Michael McCandless commented on LUCENE-2109:
--------------------------------------------

Looks good Uwe!

> Make DocsEnum subclass of DocIdSetIterator
> ------------------------------------------
>
> Key: LUCENE-2109
> URL: https://issues.apache.org/jira/browse/LUCENE-2109
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Index
> Affects Versions: Flex Branch
> Reporter: Uwe Schindler
> Assignee: Uwe Schindler
> Fix For: Flex Branch
>
> Attachments: LUCENE-2109.patch, LUCENE-2109.patch, LUCENE-2109.patch, LUCENE-2109.patch
>
>
> Spinoff from LUCENE-1458:
> One thing I came along long time ago, but now with a new API it get's interesting again:
> DocsEnum should extend DocIdSetIterator, that would make it simplier to use and implement e.g. in MatchAllDocQuery.Scorer, FieldCacheRangeFilter and so on. You could e.g. write a filter for all documents that simply returns the docs enumeration from IndexReader.
> So it should be an abstract class that extends DocIdSetIterator. It has the same methods, only some methods must be a little bit renamed. The problem is, because java does not support multiple inheritace, we cannot also extends attributesource Would DocIdSetIterator be an interface it would work (this is one of the cases where interfaces for really simple patterns can be used, like iterators).
> The problem with multiple inheritance could be solved by an additional method attributes() that creates a new AttributeSource on first access then (because constructing an AttributeSource is costly). The same applies for the other *Enums, it should be separated for lazy init.
> DocsEnum could look like this:
> {code}
> public abstract class DocsEnum extends DocIdSetIterator {
> private AttributeSource atts = null;
> public int freq()
> public DontKnowClassName positions()
> public final AttributeSource attributes() {
> if (atts==null) atts=new AttributeSource();
> return atts;
> }
> ...default impl of the bulk access using the abstract methods from DocIdSetIterator
> }
> {code}

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Dec 4, 2009, 12:39 PM

Post #5 of 6 (251 views)
Permalink
[jira] Commented: (LUCENE-2109) Make DocsEnum subclass of DocIdSetIterator [In reply to]

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

Paul Elschot commented on LUCENE-2109:
--------------------------------------

Vielen Dank für diese Gründlichkeit.

> Make DocsEnum subclass of DocIdSetIterator
> ------------------------------------------
>
> Key: LUCENE-2109
> URL: https://issues.apache.org/jira/browse/LUCENE-2109
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Index
> Affects Versions: Flex Branch
> Reporter: Uwe Schindler
> Assignee: Uwe Schindler
> Fix For: Flex Branch
>
> Attachments: LUCENE-2109.patch, LUCENE-2109.patch, LUCENE-2109.patch, LUCENE-2109.patch
>
>
> Spinoff from LUCENE-1458:
> One thing I came along long time ago, but now with a new API it get's interesting again:
> DocsEnum should extend DocIdSetIterator, that would make it simplier to use and implement e.g. in MatchAllDocQuery.Scorer, FieldCacheRangeFilter and so on. You could e.g. write a filter for all documents that simply returns the docs enumeration from IndexReader.
> So it should be an abstract class that extends DocIdSetIterator. It has the same methods, only some methods must be a little bit renamed. The problem is, because java does not support multiple inheritace, we cannot also extends attributesource Would DocIdSetIterator be an interface it would work (this is one of the cases where interfaces for really simple patterns can be used, like iterators).
> The problem with multiple inheritance could be solved by an additional method attributes() that creates a new AttributeSource on first access then (because constructing an AttributeSource is costly). The same applies for the other *Enums, it should be separated for lazy init.
> DocsEnum could look like this:
> {code}
> public abstract class DocsEnum extends DocIdSetIterator {
> private AttributeSource atts = null;
> public int freq()
> public DontKnowClassName positions()
> public final AttributeSource attributes() {
> if (atts==null) atts=new AttributeSource();
> return atts;
> }
> ...default impl of the bulk access using the abstract methods from DocIdSetIterator
> }
> {code}

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


jira at apache

Dec 4, 2009, 1:15 PM

Post #6 of 6 (253 views)
Permalink
[jira] Commented: (LUCENE-2109) Make DocsEnum subclass of DocIdSetIterator [In reply to]

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

Uwe Schindler commented on LUCENE-2109:
---------------------------------------

Danke! Mache ich doch gerne!

> Make DocsEnum subclass of DocIdSetIterator
> ------------------------------------------
>
> Key: LUCENE-2109
> URL: https://issues.apache.org/jira/browse/LUCENE-2109
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Index
> Affects Versions: Flex Branch
> Reporter: Uwe Schindler
> Assignee: Uwe Schindler
> Fix For: Flex Branch
>
> Attachments: LUCENE-2109.patch, LUCENE-2109.patch, LUCENE-2109.patch, LUCENE-2109.patch
>
>
> Spinoff from LUCENE-1458:
> One thing I came along long time ago, but now with a new API it get's interesting again:
> DocsEnum should extend DocIdSetIterator, that would make it simplier to use and implement e.g. in MatchAllDocQuery.Scorer, FieldCacheRangeFilter and so on. You could e.g. write a filter for all documents that simply returns the docs enumeration from IndexReader.
> So it should be an abstract class that extends DocIdSetIterator. It has the same methods, only some methods must be a little bit renamed. The problem is, because java does not support multiple inheritace, we cannot also extends attributesource Would DocIdSetIterator be an interface it would work (this is one of the cases where interfaces for really simple patterns can be used, like iterators).
> The problem with multiple inheritance could be solved by an additional method attributes() that creates a new AttributeSource on first access then (because constructing an AttributeSource is costly). The same applies for the other *Enums, it should be separated for lazy init.
> DocsEnum could look like this:
> {code}
> public abstract class DocsEnum extends DocIdSetIterator {
> private AttributeSource atts = null;
> public int freq()
> public DontKnowClassName positions()
> public final AttributeSource attributes() {
> if (atts==null) atts=new AttributeSource();
> return atts;
> }
> ...default impl of the bulk access using the abstract methods from DocIdSetIterator
> }
> {code}

--
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: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.