You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Espen Amble Kolstad (JIRA)" <ji...@apache.org> on 2007/10/26 09:11:50 UTC

[jira] Created: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
----------------------------------------------------------------------------------------

                 Key: SOLR-398
                 URL: https://issues.apache.org/jira/browse/SOLR-398
             Project: Solr
          Issue Type: Improvement
          Components: update
    Affects Versions: 1.2, 1.3
            Reporter: Espen Amble Kolstad
            Priority: Minor


FieldType.createField currently returns Field.

In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Espen Amble Kolstad updated SOLR-398:
-------------------------------------

    Attachment: trunk-FieldType-3.patch

I've updated the patch for trunk

All tests pass

Any chance of this making into 1.3?

Espen

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, 1.2-FieldType.patch, trunk-FieldType-3.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626122#action_12626122 ] 

Espen Amble Kolstad commented on SOLR-398:
------------------------------------------

All tests pass :-)

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, trunk-FieldType-3.patch, trunk-FieldType-4.patch, trunk-FieldType-5.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar updated SOLR-398:
---------------------------------------

    Fix Version/s: 1.5

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: 1.2-FieldType-2.patch, trunk-FieldType-3.patch, trunk-FieldType-4.patch, trunk-FieldType-5.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Espen Amble Kolstad updated SOLR-398:
-------------------------------------

    Attachment: trunk-FieldType-4.patch

Here's an updated patch for trunk

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, trunk-FieldType-3.patch, trunk-FieldType-4.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Espen Amble Kolstad updated SOLR-398:
-------------------------------------

    Attachment: 1.2-FieldType-2.patch
                trunk-FieldType-2.patch

Sorry for the late reply! I've been on holiday.

I've given it another go where I've deprecated createField and added createFieldable in both FieldType and SchemaField.
FieldType.createFieldable currently only calls createField to maintain backwards compatability

Comments?

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, 1.2-FieldType.patch, trunk-FieldType-2.patch, trunk-FieldType.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Espen Amble Kolstad updated SOLR-398:
-------------------------------------

    Attachment: 1.2-FieldType.patch
                trunk-FieldType.patch

Here are patches fro trunk and 1.2

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType.patch, trunk-FieldType.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Espen Amble Kolstad updated SOLR-398:
-------------------------------------

    Attachment:     (was: trunk-FieldType-2.patch)

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, 1.2-FieldType.patch, trunk-FieldType-3.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Andrzej Bialecki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrzej Bialecki  updated SOLR-398:
-----------------------------------

    Attachment: fieldable.patch

Patch updated to current trunk. One concrete use case where this is needed is Fieldable implementations that provide different values of tokenStreamValue() and stringValue(), e.g. when using external tools to provide a pre-tokenized value of the field.

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: 1.2-FieldType-2.patch, fieldable.patch, trunk-FieldType-3.patch, trunk-FieldType-4.patch, trunk-FieldType-5.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554485 ] 

Otis Gospodnetic commented on SOLR-398:
---------------------------------------

I'm not on a computer where I can try this out, but this looks simple and shouldn't hold up OpenPipe.
All unit tests still pass, Espen?


> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType.patch, trunk-FieldType.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554575 ] 

Grant Ingersoll commented on SOLR-398:
--------------------------------------

This will break back-compatibility, right?  Better to deprecate and add a new method?

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType.patch, trunk-FieldType.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586728#action_12586728 ] 

kolstae edited comment on SOLR-398 at 4/8/08 2:45 AM:
------------------------------------------------------------------

I've updated the patch for trunk

All tests pass

Any chance of this making it into 1.3?

Espen

      was (Author: kolstae):
    I've updated the patch for trunk

All tests pass

Any chance of this making into 1.3?

Espen
  
> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, trunk-FieldType-3.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554581 ] 

Yonik Seeley commented on SOLR-398:
-----------------------------------

{quote}This will break back-compatibility, right?{quote}
Unfortunately, yes.  That's why I only changed methods that accepted a Field, but couldn't change return types because of potential code like:  Field f = ft.createField()

{quote}Better to deprecate and add a new method?{quote}
Probably, if creation of fields might be done in custom request handlers.

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType.patch, trunk-FieldType.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Andrzej Bialecki (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626099#action_12626099 ] 

Andrzej Bialecki  commented on SOLR-398:
----------------------------------------

Great minds think alike :) I was about to submit exactly the same patch when I noticed this JIRA.

One thing is missing in your patch - DocumentBuilder:282 should use "out.getFieldable()" instead of "out.getField()". This is required if you provide a custom Fieldable implementation (!instanceof o.a.l.d.Field) in FieldType subclasses, because o.a.l.d.Document.getField tries to cast the result to o.a.l.d.Field, whereas Document.getFieldable is happy with any subclass of Fieldable ;)

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, trunk-FieldType-3.patch, trunk-FieldType-4.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Espen Amble Kolstad updated SOLR-398:
-------------------------------------

    Attachment: trunk-FieldType-5.patch

You are right. There are some other places where Document.getField(String name) was used. I changed them as well.
I've included the new patch

Document.getField(String name) should be rewritten or deprecated ?!

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, trunk-FieldType-3.patch, trunk-FieldType-4.patch, trunk-FieldType-5.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Espen Amble Kolstad updated SOLR-398:
-------------------------------------

    Attachment:     (was: trunk-FieldType.patch)

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, 1.2-FieldType.patch, trunk-FieldType-3.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-398) Widen return type of FiledType.createField to Fieldable in order to maximize flexibility

Posted by "Espen Amble Kolstad (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Espen Amble Kolstad updated SOLR-398:
-------------------------------------

    Attachment:     (was: 1.2-FieldType.patch)

> Widen return type of FiledType.createField to Fieldable in order to maximize flexibility
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-398
>                 URL: https://issues.apache.org/jira/browse/SOLR-398
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 1.2, 1.3
>            Reporter: Espen Amble Kolstad
>            Priority: Minor
>         Attachments: 1.2-FieldType-2.patch, trunk-FieldType-3.patch
>
>
> FieldType.createField currently returns Field.
> In order to maximize flexibility for developers to extend Solr, it should return Fieldable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.