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

Simon Willnauer commented on LUCENE-2310:
-----------------------------------------

Hey Chris,

good that you reactivate this issue! I was looking into similar stuff while 
working on docvalues since it really needs to add stuff to Field / Fieldable. 
With a cleanup and eventually FieldType this would be way less painless I 
guess. I have a couple of questions and comments to the current patch. 
Btw. I like the fact that the previous patch was uploaded March 21 2010 and the 
latest took 1 year to come up on march 23 2011 :)

* Why do you reformat all the stuff in Field, is that necessary here at all? I 
mean its needed eventually but for the deprecation of things it only bloats the 
patch really doesn't it?

* When you deprecate AbstractField and Fieldable, Field should ideally be a 
standalone class. So I see that this still needs to subclass Fieldable / 
AbstractField but could it stand alone now so that we can simply remove the 
extends / implements on Field once we drop things in 4.0? I think it looks good 
from looking at the patch though

* I don't like the name getAllFields on Document since it implies that we have 
a getPartialFields or something. I see that you can not use getFields since it 
only differs in return type which doesn't belong to the signature though. Maybe 
we should implement Iterable<Field> here and offer an additional method 
getFieldsAsList or maybe getFields(List<Field> fields)

* once we have this in what are the next steps towards FieldType? Will we have 
only one class Field that is backed by a FieldType but still offers the methods 
it has now? Or doe we have two totally new classes FieldTyps and FieldValue, 
something like this:
{code} 
class FieldValue {
  FieldType type;
  float boost;
  String name;
  Object value;
}
{code}

* I wonder if this patch raises tons of deprecation warnings all over lucene 
where Fieldable was used? In IW we use it all over the place though. We must 
fix that in this issue too otherwise uwe will go mad I guess :)

thanks for bringing this up again!

> 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, LUCENE-2310.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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to