webservice-solr
webservice-solr copied to clipboard
Replace XML::Easy by a more recent module?
The module XML::Easy has not been updated since 2017,
and now cannot be compiled anymore on more recent architectures,
at least on in an easy way:
e.g. Mac OS X (partly given)
$ cpanm -n XML::Easy
Building XML-Easy
cc -I/Users/njfranck/.plenv/versions/5.40.0/lib/perl5/5.40.0/darwin-2level/CORE '-DVERSION="0.011"' '-DXS_VERSION="0.011"' -c -fno-common -DPERL_DARWIN '-mmacosx-version-min=14.5' -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include '-Wno-error=implicit-function-declaration' -O3 -o lib/XML/Easy.o lib/XML/Easy.c
lib/XML/Easy.xs:9:9: warning: 'PERL_VERSION_GE' macro redefined [-Wmacro-redefined]
9 | #define PERL_VERSION_GE(r,v,s) \
can this dependency be replaced by something more recent?
I have no objection to changing it to something else. My only concern is that I wouldn't want something that brought in a ton of dependencies.
I also wouldn't mind having communication with the server being in JSON instead of XML.
I also wouldn't mind having communication with the server being in JSON instead of XML.
I would too, however keep in mind that the JSON that Solr expects allows for repeated keys (e.g. "add"), and is something you cannot easily do in regular json modules. See https://solr.apache.org/guide/solr/latest/indexing-guide/indexing-with-update-handlers.html#sending-json-update-commands
curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/my_collection/update' --data-binary '
{
"add": {
"doc": {
"id": "DOC1",
"my_field": 2.3,
"my_multivalued_field": [ "aaa", "bbb" ]
}
},
"add": {
"commitWithin": 5000,
"overwrite": false,
"doc": {
"f1": "v1",
"f1": "v2"
}
},
}
I would too, however keep in mind that the JSON that Solr expects allows for repeated keys (e.g. "add"),
Well so much for that idea. Thanks for the warning.
Just on a basic survey of CPAN, I'm thinking XML::Writer might be the way to go. I like the idea of write-only.