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 "Ryan McKinley (JIRA)" <ji...@apache.org> on 2008/12/18 12:50:44 UTC

[jira] Created: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
------------------------------------------------------------------------

                 Key: SOLR-928
                 URL: https://issues.apache.org/jira/browse/SOLR-928
             Project: Solr
          Issue Type: New Feature
    Affects Versions: 1.3
            Reporter: Ryan McKinley


The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.

Exposing the Map<String,Object> interface enables users to automatically plug into existing code that supports these interfaces.  In particular there are many GUI "bean" editors that support this interface already.

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


[jira] Commented: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657746#action_12657746 ] 

Ryan McKinley commented on SOLR-928:
------------------------------------

For background -- I know we kept the Map implementation hidden since I wanted the option to switch various implementations for slightly different behavior (TreeMap, HashMap, LinkedHashMap).

We could either extend on of the Map implementation directly or implement Map and wrap each call.

In practice, it seems unlikely we will change the underlying implementation, so i think the cleaner option is to just extend HashMap or LinkedHashMap.


> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that supports these interfaces.  In particular there are many GUI "bean" editors that support this interface already.

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


[jira] Updated: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

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

Ryan McKinley updated SOLR-928:
-------------------------------

    Attachment: SOLR-928-SolrDocument-Map.patch

Here is a new patch where Solr{Input}Document implements Map<String,Object> rather then extends

for each function it calls something like: 
{code:java}
+  @Override
+  public Set<String> keySet() {
+    return _fields.keySet();
+  }
{code}

> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>         Attachments: SOLR-928-SolrDocument-Map.patch, SOLR-928-SolrDocument-Map.patch
>
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that support Map<>.  In particular many GUI "bean" editors and viewers that support Map<> out of the box.

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


[jira] Resolved: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

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

Ryan McKinley resolved SOLR-928.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4

> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>             Fix For: 1.4
>
>         Attachments: SOLR-928-SolrDocument-Map.patch, SOLR-928-SolrDocument-Map.patch
>
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that support Map<>.  In particular many GUI "bean" editors and viewers that support Map<> out of the box.

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


[jira] Updated: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

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

Ryan McKinley updated SOLR-928:
-------------------------------

    Attachment: SOLR-928-SolrDocument-Map.patch

Here is a patch that has each class extend LinkedHashMap<String,Object>

In general, most of the internal changes look like this:
{code:java}
public SolrInputField getField( String field )
{
-   return _fields.get( field );
+   return get( field );
}
{code}

> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>         Attachments: SOLR-928-SolrDocument-Map.patch
>
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that supports these interfaces.  In particular there are many GUI "bean" editors that support this interface already.

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


[jira] Commented: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657858#action_12657858 ] 

Ryan McKinley commented on SOLR-928:
------------------------------------

This makes the class description look like this:

{code:java}
public class SolrDocument implements Map<String,Object>, Iterable<Map.Entry<String, Object>>, Serializable

public class SolrInputDocument implements Map<String,SolrInputField>, Iterable<SolrInputField>, Serializable
{code}

> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>         Attachments: SOLR-928-SolrDocument-Map.patch, SOLR-928-SolrDocument-Map.patch
>
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that support Map<>.  In particular many GUI "bean" editors and viewers that support Map<> out of the box.

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


[jira] Commented: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

Posted by "Ryan McKinley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658109#action_12658109 ] 

Ryan McKinley commented on SOLR-928:
------------------------------------

any other thoughts on this?

I'd like to commit soon...

> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>         Attachments: SOLR-928-SolrDocument-Map.patch, SOLR-928-SolrDocument-Map.patch
>
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that support Map<>.  In particular many GUI "bean" editors and viewers that support Map<> out of the box.

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


[jira] Updated: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

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

Ryan McKinley updated SOLR-928:
-------------------------------

    Description: 
The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.

Exposing the Map<String,Object> interface enables users to automatically plug into existing code that support Map<>.  In particular many GUI "bean" editors and viewers that support Map<> out of the box.

  was:
The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.

Exposing the Map<String,Object> interface enables users to automatically plug into existing code that supports these interfaces.  In particular there are many GUI "bean" editors that support this interface already.


> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>         Attachments: SOLR-928-SolrDocument-Map.patch
>
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that support Map<>.  In particular many GUI "bean" editors and viewers that support Map<> out of the box.

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


[jira] Commented: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

Posted by "Erik Hatcher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657824#action_12657824 ] 

Erik Hatcher commented on SOLR-928:
-----------------------------------

you're a saint!   thank you thank you thank you.

> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>         Attachments: SOLR-928-SolrDocument-Map.patch
>
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that support Map<>.  In particular many GUI "bean" editors and viewers that support Map<> out of the box.

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


[jira] Assigned: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

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

Ryan McKinley reassigned SOLR-928:
----------------------------------

    Assignee: Ryan McKinley

> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>            Assignee: Ryan McKinley
>             Fix For: 1.4
>
>         Attachments: SOLR-928-SolrDocument-Map.patch, SOLR-928-SolrDocument-Map.patch
>
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that support Map<>.  In particular many GUI "bean" editors and viewers that support Map<> out of the box.

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


[jira] Commented: (SOLR-928) SolrDocument/SolrInputDocument could extend/implement Map

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657831#action_12657831 ] 

Hoss Man commented on SOLR-928:
-------------------------------

bq. We could either extend on of the Map implementation directly or implement Map and wrap each call.

I would prefer implementing the interface via composition instead of inheritance ... even if we don't anticipate ever changing he underlying datastructure there's no reason to lock ourselves into a contract for no reason.

> SolrDocument/SolrInputDocument could extend/implement Map<String,Object>
> ------------------------------------------------------------------------
>
>                 Key: SOLR-928
>                 URL: https://issues.apache.org/jira/browse/SOLR-928
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>         Attachments: SOLR-928-SolrDocument-Map.patch
>
>
> The existing SolrDocument and SolrInputDocuments are backed by Map<String,Object>, however the Map interface is not available to end users.
> Exposing the Map<String,Object> interface enables users to automatically plug into existing code that support Map<>.  In particular many GUI "bean" editors and viewers that support Map<> out of the box.

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