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

Michael McCandless commented on LUCENE-2310:
--------------------------------------------

I wonder if, like we're thinking for analysis, we can substantially
reduce the Document/Field API that's consumed by the indexer....

Really all indexer needs to do is:

  * Iterate the indexed fields, for each getting a name, a TokenStream
    (or possibly something more pared-back -- don't need close nor
    reset), and a FieldType containing indexing settings (omits
    positions, omits term freq, etc.)

  * Iterate the stored fields, for each getting name and value (or,
    possibly, only a serialize() method, instead?)

The iterators would be unmodifiable.

Indexer could care less how these are implemented.

Lucene would still provide a fully featured concrete Document/Field
classes that're app-friendly, ie malleable, with clear, add/remove
fields, etc.  I think Document & Field can be fully concrete?  Ie no
more AbstractField/Fieldable.  It's simply a convenience class offered
to apps.

Indexer would not see that class.  It would only see the above minimal
interface.  So for expert apps that don't want to use Lucene's
convenient Document/Field, they can easily make their own impls of
that interface.


> Reduce Fieldable, AbstractField and Field complexity
> ----------------------------------------------------
>
>                 Key: LUCENE-2310
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2310
>             Project: Lucene - Java
>          Issue Type: Sub-task
>          Components: Index
>            Reporter: Chris Male
>         Attachments: LUCENE-2310-Deprecate-AbstractField-CleanField.patch, 
> LUCENE-2310-Deprecate-AbstractField.patch, 
> LUCENE-2310-Deprecate-AbstractField.patch, 
> LUCENE-2310-Deprecate-AbstractField.patch, 
> LUCENE-2310-Deprecate-DocumentGetFields-core.patch, 
> LUCENE-2310-Deprecate-DocumentGetFields.patch, 
> LUCENE-2310-Deprecate-DocumentGetFields.patch
>
>
> In order to move field type like functionality into its own class, we really 
> need to try to tackle the hierarchy of Fieldable, AbstractField and Field.  
> Currently AbstractField depends on Field, and does not provide much more 
> functionality that storing fields, most of which are being moved over to 
> FieldType.  Therefore it seems ideal to try to deprecate AbstractField (and 
> possible Fieldable), moving much of the functionality into Field and 
> FieldType.

-- 
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-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to