Thanks Chris,
this idea has been discussed before, most notably in this thread...
http://www.nabble.com/Indexing-XML-files-to7705775.html
...as discussed there, the crux of the isue is not a special fieldtype,
but a custom ResponseWriter that outputs the XML you want, and leaves any
field values you want unescaped (assuming you trust them to be wellformed)
how you decide what field values to leave unescaped could either be
hardcoded, or driven by the FieldType of each field (in which case you
might write an XmlField that subclasses StrField, but you wouldn't need to
override any methods -- just see that the FieldType is XmlField and use
that as your guide.
Sorry to haven't find this link. I discovered that I have done exactly
the same as mirko-9
<http://www.nabble.com/Re%3A-Indexing-XML-files-p7742668.html>
xmlWriter.writePrim("xml", name, f.stringValue(), false);
So, this a good way to implement our need, but, there's good reasons to
not commit it to Solr core : XmlResponseWriter schema, code injection
risks. Such prudence make us very confident in Solr.
: I would be glad that this class could be commited, so that I do not need to
: keep it up to date with future Solr release.
as long as you stick to the contracts of FieldType and/or ResponseWriter
you don't need to worry -- these are published SolrPlugin APIs that Solr
won't break ... we expect people to implment them, and people can expect
their plugins to work when they upgrade Solr.
--
Frédéric Glorieux