You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2006/11/20 20:45:06 UTC

[jira] Commented: (LUCENE-719) IndexModifier does not support all APIs from IndexWriter/IndexReader

    [ http://issues.apache.org/jira/browse/LUCENE-719?page=comments#action_12451395 ] 
            
Hoss Man commented on LUCENE-719:
---------------------------------

The merrits of IndexWriter and IndexReader being interfaces not withstanding, the purpose of IndexModifier is to provide a *simpler* API for people then they would have if they dealt with both an IndexWriter and IndexReader ...  including all of the methods from both classes doesnt' really seem like it would achieve that goal.

from the IndexModifier javadocs...

      Not all methods of IndexReader and IndexWriter are offered by this class. If you need access to 
      additional methods, either use those classes directly or implement your own class that extends 
      IndexModifier.

...there may be some methods recently added to IndexReader or IndexWriter which warrant addition to IndexModifier, but they should be considered individually.

Regarding the specific example of maxDoc ... that seems like a method most "high level" clients that would use IndexModifier wouldn't need ... is there a particular case where a client is doing something low level evnough to need that method where they wouldn't already need to deal with an IndexReader directly anyway?


> IndexModifier does not support all APIs from IndexWriter/IndexReader
> --------------------------------------------------------------------
>
>                 Key: LUCENE-719
>                 URL: http://issues.apache.org/jira/browse/LUCENE-719
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 1.9, 2.0.0, 2.1, 2.0.1
>         Environment: n/a
>            Reporter: Matthew Bogosian
>            Priority: Minor
>
> IndexModifer should probably provide all of the methods defined in both IndexReader and IndexWriter. Currently it does not (e.g., IndexReader.maxDoc() is not available).
> One way to do this *might* be to have IndexReader and IndexWriter interfaces. For example:
> package org.apache.lucene.index.interface;
> public interface IndexReader {
>     ...
>     int maxDoc();
>     ...
> }
> Then the IndexReader and IndexWriter classes could implement those interfaces:
> package org.apache.lucene.index;
> public abstract class IndexReader implements org.apache.lucene.index.interface IndexReader {
>     ...
>     public int maxDoc() {
>         ...
>     }
>     ...
> }
> The IndexModifier could then implement both:
> public class IndexModifier implements org.apache.lucene.index.interface IndexReader,
>         org.apache.lucene.index.interface IndexWriter {
>     ...
> }
> Anywhere an IndexWriter or IndexReader was needed, one would require an object which implemented the appropriate interface:
> package org.apache.lucene.index;
> public class MultiReader extends IndexReader {
>     ...
>     MultiReader(org.apache.lucene.index.interface.IndexReader[] subReaders) {
>         ...
>     }
>     ...
> }
> Just a thought....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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