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

Michael McCandless commented on LUCENE-4101:
--------------------------------------------

Sorry, I don't intend to rush this.

I set it to blocker because I think the 4.0 API for creating stored
fields is confusing now (separate from the changes being explored in
LUCENE-3312).

This (XXXField/FieldType) is one of the major changed APIs in 4.0 so
it's worth spending effort reviewing/fixing it before we ship it.  The
same goes for all our other new AIPs in 4.0: we should scrutinize them.

bq. personally i dont like the fact you have to add the field twice.

Expert users don't have to (they can make a custom field type, at least
until 5.0).  This API is just for basic usage, and I think it's
important that API be really easy to use.

Today in 4.0 you do this for an un-stored field:
{noformat}
new StringField("title", "...");
{noformat}

and this for a stored field:

{noformat}
new Field("title", "...", StringField.TYPE_STORED);
{noformat}

I think that's a confusing API.  EG, you don't know whether StringField,
IntField, etc., are stored by default.  When you do want to store a
field you suddenly must use the expert API (Field directly) and specify
this custom FieldType.  So I think we should improve this... we already
have StoredField and I think a strong decoupling of "it's stored" from
"all the other neat ways the field can be indexed" is clean.

I guess another option would be to splinter out StoredXXXField?  Ie:
{noformat}
new StoredStringField("title", "...");
{noformat}

But that's gonna double all the XXXFields we have.

                
> Remove XXXField.TYPE_STORED
> ---------------------------
>
>                 Key: LUCENE-4101
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4101
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Blocker
>             Fix For: 4.0, 5.0
>
>         Attachments: LUCENE-4101.patch
>
>
> Spinoff from LUCENE-3312.
> For 4.0 I think we should simplify the sugar field APIs by requiring
> that you add a StoredField if you want to store the field.  Expert users
> can still make a custom FieldType that both stores and indexes...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to