Hey Chris, Awesome explanation.
...then solr has no idea what full field name to use as the destination > when it seees values in a field "foo" ... should it be "1_bar" ? > "aaa_bar" ? ... "zzzzzzzzzzzzzzzzzzzzzzzzz_bar" ? all three? But how does Solr get the idea what full field name to use as the destination when we provide wildcard in source as well? Seems I'm missing something. but using a wildcard in the dest only woks with a one-to-one mapping So, I think, this restriction could be more related to the source code flow instead of a logical reason. I'll try to understand the code about this. I was actually curious if there's any logical restriction that I had been missing. Many thanks. :) On Thu, 24 Oct 2019 at 03:47, Chris Hostetter <hossman_luc...@fucit.org> wrote: > > : Documentation says that we can copy multiple fields using wildcard to one > : or more than one fields. > > correct ... the limitation is in the syntax and the ambiguity that would > be unresolvable if you had a wildcard in the dest but not in the source. > > the wildcard is essentially a variable. if you have... > > source="foo" desc="*_bar" > > ...then solr has no idea what full field name to use as the destination > when it seees values in a field "foo" ... should it be "1_bar" ? > "aaa_bar" ? ... "zzzzzzzzzzzzzzzzzzzzzzzzz_bar" ? all three? > > : Yes, that's what hit me initially. But, "*_x" while indexing (in XMLs) > : doesn't mean anything, right? It's only used in dynamicFields while > : defining schema to let Solr know that we would have some undeclared > fields > > use of wildcards in copyField is not contstrained to only > using dynamicFields, this would be a perfectly valid copyField using > wildcards, even if these are the only fields in the schema, and it had > no dynamicFields at all... > > <field name="title_en" .../> > <field name="title_fr" .../> > <field name="title_tr" .../> > > <field name="text_en" .../> > <field name="text_fr" .../> > <field name="text_tr" .../> > > <copyField source="title_*" dest="text_*" /> > > : having names like this. Also, according to the documentation, we can have > : dest="*_x" when source="*_x" if I'm right. In this case, there's support > : for multiple destinations when there are multiple source. > > correct. there is support for copying from one field to another > via a *MAPPING* -- so a single copyField declaration can go from multiple > sources to multiple destiations, but using a wildcard in the dest > only woks with a one-to-one mapping when the wildcard also exists in the > source. > > on the flip side however, you have have a many-to-one mapping by using a > wildcard *only* in the source.... > > <field name="title_en" .../> > <field name="title_fr" .../> > <field name="title_tr" .../> > > <field name="text" .../> > > <copyField source="title_*" dest="text" /> > > > > -Hoss > http://www.lucidworks.com/ > -- -- Regards, *Paras Lehana* [65871] Development Engineer, Auto-Suggest, IndiaMART Intermesh Ltd. 8th Floor, Tower A, Advant-Navis Business Park, Sector 142, Noida, UP, IN - 201303 Mob.: +91-9560911996 Work: 01203916600 | Extn: *8173* -- IMPORTANT: NEVER share your IndiaMART OTP/ Password with anyone.