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 "Edward Rudd (JIRA)" <ji...@apache.org> on 2009/01/23 18:25:59 UTC

[jira] Created: (SOLR-979) add ability to specify multiple values for a Key in a Script transformer

add ability to specify multiple values for a Key in a Script transformer
------------------------------------------------------------------------

                 Key: SOLR-979
                 URL: https://issues.apache.org/jira/browse/SOLR-979
             Project: Solr
          Issue Type: New Feature
          Components: contrib - DataImportHandler
         Environment: openJDK 1.6.0 b12, CentOS 5 x86, Jetty 6
            Reporter: Edward Rudd


In writing my DIH configuration for my Knowledge base code I ran across a need to have a script transformer create multiple values for a single schema field, and the Map object does not allow this (unless I can put an array as the value for that key).

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


[jira] Commented: (SOLR-979) add ability to specify multiple values for a Key in a Script transformer

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666637#action_12666637 ] 

Shalin Shekhar Mangar commented on SOLR-979:
--------------------------------------------

Edward, multiple values can be specified as a Java Collection object. So basically you need to create List of your values and add them for to the map for your field. I'm sure there is a way to do that with scripts, I just don't know how. Perhaps the javascript list is converted automatically to Java List by Rhino (the default javascript engine in JDK6)?

> add ability to specify multiple values for a Key in a Script transformer
> ------------------------------------------------------------------------
>
>                 Key: SOLR-979
>                 URL: https://issues.apache.org/jira/browse/SOLR-979
>             Project: Solr
>          Issue Type: New Feature
>          Components: contrib - DataImportHandler
>         Environment: openJDK 1.6.0 b12, CentOS 5 x86, Jetty 6
>            Reporter: Edward Rudd
>
> In writing my DIH configuration for my Knowledge base code I ran across a need to have a script transformer create multiple values for a single schema field, and the Map object does not allow this (unless I can put an array as the value for that key).

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


[jira] Commented: (SOLR-979) add ability to specify multiple values for a Key in a Script transformer

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666861#action_12666861 ] 

Noble Paul commented on SOLR-979:
---------------------------------

you can put only a valid java collection in the map

try this
{code}
var arr = new java.util.ArrayList();
arr.add('hello');
arr.add('world');
row.put('terms',arr);
{code}
HTH

> add ability to specify multiple values for a Key in a Script transformer
> ------------------------------------------------------------------------
>
>                 Key: SOLR-979
>                 URL: https://issues.apache.org/jira/browse/SOLR-979
>             Project: Solr
>          Issue Type: New Feature
>          Components: contrib - DataImportHandler
>         Environment: openJDK 1.6.0 b12, CentOS 5 x86, Jetty 6
>            Reporter: Edward Rudd
>
> In writing my DIH configuration for my Knowledge base code I ran across a need to have a script transformer create multiple values for a single schema field, and the Map object does not allow this (unless I can put an array as the value for that key).

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


[jira] Commented: (SOLR-979) add ability to specify multiple values for a Key in a Script transformer

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668131#action_12668131 ] 

Shalin Shekhar Mangar commented on SOLR-979:
--------------------------------------------

Edward, many thanks for updating the wiki with the instructions

> add ability to specify multiple values for a Key in a Script transformer
> ------------------------------------------------------------------------
>
>                 Key: SOLR-979
>                 URL: https://issues.apache.org/jira/browse/SOLR-979
>             Project: Solr
>          Issue Type: New Feature
>          Components: contrib - DataImportHandler
>         Environment: openJDK 1.6.0 b12, CentOS 5 x86, Jetty 6
>            Reporter: Edward Rudd
>
> In writing my DIH configuration for my Knowledge base code I ran across a need to have a script transformer create multiple values for a single schema field, and the Map object does not allow this (unless I can put an array as the value for that key).

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


[jira] Commented: (SOLR-979) add ability to specify multiple values for a Key in a Script transformer

Posted by "Edward Rudd (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666736#action_12666736 ] 

Edward Rudd commented on SOLR-979:
----------------------------------

Well I did a quick test of adding a JS array to the Map and it came back as the string representation of the Rhino array Java class. (ie.. not mapped to a java collection)..   

I'll have to hunt and read through the documentation for JDK 1.6's JS component to figure out even how to create a collection within the JS..  Or add a check in DIH to iterate through the JS array object as well.

I'll have more time to play w/ this on monday and see what I find out.

> add ability to specify multiple values for a Key in a Script transformer
> ------------------------------------------------------------------------
>
>                 Key: SOLR-979
>                 URL: https://issues.apache.org/jira/browse/SOLR-979
>             Project: Solr
>          Issue Type: New Feature
>          Components: contrib - DataImportHandler
>         Environment: openJDK 1.6.0 b12, CentOS 5 x86, Jetty 6
>            Reporter: Edward Rudd
>
> In writing my DIH configuration for my Knowledge base code I ran across a need to have a script transformer create multiple values for a single schema field, and the Map object does not allow this (unless I can put an array as the value for that key).

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


[jira] Closed: (SOLR-979) add ability to specify multiple values for a Key in a Script transformer

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

Edward Rudd closed SOLR-979.
----------------------------

    Resolution: Invalid

using new java.util.ArrayList() worked.. Thanks..  

I'm going to update the WIKI page to add some more explanation and examples on the ScriptTransformer

> add ability to specify multiple values for a Key in a Script transformer
> ------------------------------------------------------------------------
>
>                 Key: SOLR-979
>                 URL: https://issues.apache.org/jira/browse/SOLR-979
>             Project: Solr
>          Issue Type: New Feature
>          Components: contrib - DataImportHandler
>         Environment: openJDK 1.6.0 b12, CentOS 5 x86, Jetty 6
>            Reporter: Edward Rudd
>
> In writing my DIH configuration for my Knowledge base code I ran across a need to have a script transformer create multiple values for a single schema field, and the Map object does not allow this (unless I can put an array as the value for that key).

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