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 2007/07/17 06:54:04 UTC

[jira] Created: (SOLR-306) copyFields with a dynamic destination should support static source

copyFields with a dynamic destination should support static source
------------------------------------------------------------------

                 Key: SOLR-306
                 URL: https://issues.apache.org/jira/browse/SOLR-306
             Project: Solr
          Issue Type: Improvement
            Reporter: Ryan McKinley
            Priority: Minor
             Fix For: 1.3


In SOLR-226, we added support for copy fields with a dynamic destination.

We should also support dynamic copyFields with a static source:
 <copyField source="name" dest="text_*" /> 

This will copy the contents of "name" to "text_name"



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


[jira] Updated: (SOLR-306) copyFields with a dynamic destination should support static source

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

Ryan McKinley updated SOLR-306:
-------------------------------

    Attachment: SOLR-306-CopyField.patch

restructured code to make this work.

The relevant change was to add type 'EQUALS' to DynamicReplacement.  

> copyFields with a dynamic destination should support static source
> ------------------------------------------------------------------
>
>                 Key: SOLR-306
>                 URL: https://issues.apache.org/jira/browse/SOLR-306
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: SOLR-306-CopyField.patch
>
>
> In SOLR-226, we added support for copy fields with a dynamic destination.
> We should also support dynamic copyFields with a static source:
>  <copyField source="name" dest="text_*" /> 
> This will copy the contents of "name" to "text_name"

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


[jira] Resolved: (SOLR-306) copyFields with a dynamic destination should support static source

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

Ryan McKinley resolved SOLR-306.
--------------------------------

    Resolution: Invalid

> copyFields with a dynamic destination should support static source
> ------------------------------------------------------------------
>
>                 Key: SOLR-306
>                 URL: https://issues.apache.org/jira/browse/SOLR-306
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: SOLR-306-CopyField.patch
>
>
> In SOLR-226, we added support for copy fields with a dynamic destination.
> We should also support dynamic copyFields with a static source:
>  <copyField source="name" dest="text_*" /> 
> This will copy the contents of "name" to "text_name"

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


[jira] Commented: (SOLR-306) copyFields with a dynamic destination should support static source

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

Yonik Seeley commented on SOLR-306:
-----------------------------------

Of course if the source isn't dynamic, there really isn't a reason for this feature at all.

> copyFields with a dynamic destination should support static source
> ------------------------------------------------------------------
>
>                 Key: SOLR-306
>                 URL: https://issues.apache.org/jira/browse/SOLR-306
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: SOLR-306-CopyField.patch
>
>
> In SOLR-226, we added support for copy fields with a dynamic destination.
> We should also support dynamic copyFields with a static source:
>  <copyField source="name" dest="text_*" /> 
> This will copy the contents of "name" to "text_name"

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


[jira] Commented: (SOLR-306) copyFields with a dynamic destination should support static source

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

Yonik Seeley commented on SOLR-306:
-----------------------------------

Given that this looks like very simple syntactic sugar:
  source="name" dest="text_*"
is the same as
  source="name" dest="text_name"

It seems like this should be handled at schema-parse time (and not as a dynamic copyfield).


> copyFields with a dynamic destination should support static source
> ------------------------------------------------------------------
>
>                 Key: SOLR-306
>                 URL: https://issues.apache.org/jira/browse/SOLR-306
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: SOLR-306-CopyField.patch
>
>
> In SOLR-226, we added support for copy fields with a dynamic destination.
> We should also support dynamic copyFields with a static source:
>  <copyField source="name" dest="text_*" /> 
> This will copy the contents of "name" to "text_name"

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


[jira] Commented: (SOLR-306) copyFields with a dynamic destination should support static source

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

Hoss Man commented on SOLR-306:
-------------------------------

i'm a little worried that the syntax as described would give people the wrong impression.    the syntax added in SOLR-226 was fairly clear because there was a one to one mapping between the * in the source and the * in the dest ... there is a lot more ambiguity here.

if <copyField source="foo_*" dest="bar" /> will copy from all incoming fields starting with "foo_" to the field "bar", people might reasonably assume that  <copyField source="bar" dest="foo_*" /> will copy from the field "bar" to ALL fields starting with "foo_" ... where different people might have different assumptions about what "ALL" means ... someone might assume Solr will map it to every explicitly created field matching the pattern, others might assume it will map to every dynamicField that is based on a suffix (ie: if there are dynamic fields for *_string and *_text then a copyfield with a dest of foo_* should create foo_string and foo_text)

...the point being it could get very confusing.  it would probably be better to do this using a different tag name / syntax, to help it stand out as functionally different ... perhaps this is a good opportunity to do true regex based matching...

  <regexCopyField source="(name)" dest="text_$1" />


> copyFields with a dynamic destination should support static source
> ------------------------------------------------------------------
>
>                 Key: SOLR-306
>                 URL: https://issues.apache.org/jira/browse/SOLR-306
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: SOLR-306-CopyField.patch
>
>
> In SOLR-226, we added support for copy fields with a dynamic destination.
> We should also support dynamic copyFields with a static source:
>  <copyField source="name" dest="text_*" /> 
> This will copy the contents of "name" to "text_name"

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


[jira] Commented: (SOLR-306) copyFields with a dynamic destination should support static source

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

Ryan McKinley commented on SOLR-306:
------------------------------------

Yonik - good point.  Taking that, this can be reduced to:

Index: src/java/org/apache/solr/schema/IndexSchema.java
===================================================================
--- src/java/org/apache/solr/schema/IndexSchema.java    (revision 557002)
+++ src/java/org/apache/solr/schema/IndexSchema.java    (working copy)
@@ -525,12 +525,12 @@
           else {
             dCopies.add(new DynamicCopy(source, d));
           }
-        }
-        else if( destIsPattern ) {
-          String msg =  "copyField only supports a dynamic destination if the source is also dynamic" ;
-          throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, msg );
         }
         else {
+          if( destIsPattern ) {
+            d = getField(dest.replace( "*", source ));
+          }
+
           // retrieve the field to force an exception if it doesn't exist
           SchemaField f = getField(source);

-------------------

Hoss-

yes, I see the concern.  After realizing that the copy field isn't anything special, and I essentially need to write one/field anyway, I may as well write:
 source="name" dest="text_name" 
and be done with it.

I'll close this issue, and maybe a regex version could be started later.

> copyFields with a dynamic destination should support static source
> ------------------------------------------------------------------
>
>                 Key: SOLR-306
>                 URL: https://issues.apache.org/jira/browse/SOLR-306
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: SOLR-306-CopyField.patch
>
>
> In SOLR-226, we added support for copy fields with a dynamic destination.
> We should also support dynamic copyFields with a static source:
>  <copyField source="name" dest="text_*" /> 
> This will copy the contents of "name" to "text_name"

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


Re: [jira] Commented: (SOLR-306) copyFields with a dynamic destination should support static source

Posted by Chris Hostetter <ho...@fucit.org>.
: > maybe a regex version could be started later
:
: Don't hurry... I think that's moving in the wrong direction for good performance ;-)
: http://www.nabble.com/NO_NORMS-and-TOKENIZED--tf3064721.html#a9047635

i'd completley forgotten about that thread (was it just Feb? it seems like
a year ago)  ... a regex based approach would certainly be slower then
the prefix/suffix mechanism we have now ... but i'm guessing for a lot of
use cases it would be fine -- it's also the kind of thing whee we could
document that they expressions are evaluated in order -- putting the onus
on teh schema creator to order them based on the likelyhood of matching.



-Hoss


[jira] Commented: (SOLR-306) copyFields with a dynamic destination should support static source

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

Yonik Seeley commented on SOLR-306:
-----------------------------------

> maybe a regex version could be started later

Don't hurry... I think that's moving in the wrong direction for good performance ;-)
http://www.nabble.com/NO_NORMS-and-TOKENIZED--tf3064721.html#a9047635

> copyFields with a dynamic destination should support static source
> ------------------------------------------------------------------
>
>                 Key: SOLR-306
>                 URL: https://issues.apache.org/jira/browse/SOLR-306
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: SOLR-306-CopyField.patch
>
>
> In SOLR-226, we added support for copy fields with a dynamic destination.
> We should also support dynamic copyFields with a static source:
>  <copyField source="name" dest="text_*" /> 
> This will copy the contents of "name" to "text_name"

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