I mean this:
$ curl -o - -H 'Content-Type: application/json' --user "$solrCredentials"
--data
'{"add-copy-field":{"source":"title","dest":"title_str","indexed":true}}'
"http://127.0.0.1:8983/solr/myschema/schema"
{
"responseHeader":{
"status":400,
"QTime":0
},
"error":{
"metadata":["error-class","org.apache.solr.api.ApiBag$ExceptionWithErrObject","root-error-class","org.apache.solr.api.ApiBag$ExceptionWithErrObject"],
"details":[{
"errorMessages":["Only the 'source', 'dest' and 'maxChars' params are
allowed with the 'add-copy-field' operation"],
"add-copy-field":{
"source":"title",
"dest":"title_str",
"indexed":true
}
}],
"msg":"error processing commands, errors: [{errorMessages=[Only the
'source', 'dest' and 'maxChars' params are allowed with the 'add-copy-field'
operation], add-copy-field={source=title, dest=title_str, indexed=true}}], ",
"code":400
}
}
Mag.phil. Robert Ehrenleitner, BEng.
--
[cid:2c222a71-a2e3-451f-9923-0e896772d12a]
Mag.phil. Robert Ehrenleitner, BEng.
Web-Developer
IT-Services | Application & Digitalization Services
Hellbrunner Straße 34 | 5020 Salzburg | Austria
Tel.: +43/(0)662/8044 - 6778
www.plus.ac.at<http://www.plus.ac.at/>
________________________________
Von: Alessandro Benedetti <[email protected]>
Gesendet: Mittwoch, 2. April 2025 14:58
An: [email protected] <[email protected]>
Betreff: Re: Solr returns confusing error message regarding copy-field
[Sie erhalten nicht häufig E-Mails von [email protected]. Weitere
Informationen, warum dies wichtig ist, finden Sie unter
https://aka.ms/LearnAboutSenderIdentification ]
What do you mean with "
IMHO, the error message asks me to add indexed=true uninvertible=true or
docValues=true to title_s_lower, which is impossible, since it is a
copy-field.".
Copy-fields are like any other field, just the source for their values
comes from source fields.
You have full control over their attributes.
--------------------------
Alessandro Benedetti
Visiting card -
https://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsease.io%2Fabout%2Falessandro-benedetti&data=05%7C02%7Crobert.ehrenleitner%40plus.ac.at%7Ce8d72209ee9c4f68bc6108dd71e659ac%7C158a941a576e4e87993db2eab8526e50%7C1%7C0%7C638791957921614198%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=oWKn4LK1dWkMp4Z5VgZWiT86ExxSBcuBrFnBe1sUfSw%3D&reserved=0<https://sease.io/about/alessandro-benedetti>
<https://eur05.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Falessandro_benedetti&data=05%7C02%7Crobert.ehrenleitner%40plus.ac.at%7Ce8d72209ee9c4f68bc6108dd71e659ac%7C158a941a576e4e87993db2eab8526e50%7C1%7C0%7C638791957921650485%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=1aIEXg9bnLLhlqEo3pt1PfiplDbWJB2VFejb9A2Z194%3D&reserved=0<http://about.me/alessandro_benedetti>>
Blog -
https://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsease.io%2Fblog&data=05%7C02%7Crobert.ehrenleitner%40plus.ac.at%7Ce8d72209ee9c4f68bc6108dd71e659ac%7C158a941a576e4e87993db2eab8526e50%7C1%7C0%7C638791957921668105%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=EknKO1BefHmJkDpryoKAQj5QU%2BOmvQpedtM38o00BVE%3D&reserved=0<https://sease.io/blog>
<https://eur05.safelinks.protection.outlook.com/?url=http%3A%2F%2Falexbenedetti.blogspot.co.uk%2F&data=05%7C02%7Crobert.ehrenleitner%40plus.ac.at%7Ce8d72209ee9c4f68bc6108dd71e659ac%7C158a941a576e4e87993db2eab8526e50%7C1%7C0%7C638791957921682960%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=KhlJtx8RS9cs6byGzFcfLq1qzzuNGfHPG7Kw%2BktytF8%3D&reserved=0<http://alexbenedetti.blogspot.co.uk/>>
"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"
William Blake - Songs of Experience -1794 England
On Wed, 2 Apr 2025, 13:33 Ehrenleitner Robert Harald, <
[email protected]> wrote:
> Hi all,
>
> when querying my index and trying to sort it by title_s_lower, it responds
> with an HTTP error 400:
>
> {
> "error":{
>
> "metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","org.apache.solr.common.SolrException"],
> "msg":"can not sort on a field w/o docValues unless it is indexed=true
> uninvertible=true and the type supports Uninversion: title_s_lower",
> "code":400
> }
> }
>
> IMHO, the error message asks me to add indexed=true uninvertible=true or
> docValues=true to title_s_lower, which is impossible, since it is a
> copy-field.
>
> Excerpts of the JSON data to create the index:
>
> {
> "add-field": [
> // cut
> {
> "name": "title",
> "type": "text_general",
> "stored": true,
> "indexed": true,
> "multiValued": false,
> "required": true
> },
> // cut
> ],
> "add-copy-field": [
> {
> "source": "title",
> "dest": "title_s_lower"
> }
> ]
> // cut
>
> Can someone tell me how to fix this?
>
> Mag.phil. Robert Ehrenleitner, BEng.
> --
>
> Mag.phil. Robert Ehrenleitner, BEng.
>
> Web-Developer
>
> IT-Services | Application & Digitalization Services
>
> Hellbrunner Straße 34 | 5020 Salzburg | Austria
> <https://eur05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.google.com%2Fmaps%2Fsearch%2FHellbrunner%2BStra%25C3%259Fe%2B34%2B%257C%2B5020%2BSalzburg%2B%257C%2BAustria%3Fentry%3Dgmail%26source%3Dg&data=05%7C02%7Crobert.ehrenleitner%40plus.ac.at%7Ce8d72209ee9c4f68bc6108dd71e659ac%7C158a941a576e4e87993db2eab8526e50%7C1%7C0%7C638791957921699392%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=KxQVWMlw5qJvxogBp33kRgVnUfCd2Y1JLTaRNW7HeL0%3D&reserved=0<https://www.google.com/maps/search/Hellbrunner+Stra%C3%9Fe+34+%7C+5020+Salzburg+%7C+Austria?entry=gmail&source=g>>
>
> Tel.: +43/(0)662/8044 - 6778
>
> *www.plus.ac.at <http://www.plus.ac.at<http://www.plus.ac.at/>>*
>
>
>