You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by paulparsons <pa...@gmail.com> on 2014/05/07 00:33:11 UTC

Use XSD or DTD to make Solr schema?

I'm new to Solr, so forgive me if this is a silly question. Although I can
find some related information (in this list and elsewhere), I can't seem to
find a clear answer to my specific question: 

If I have a DTD or XSD that describes the structure of a set of XML
documents that I have, is there some way to convert that into the schema.xml
that Solr requires? Or do I need to construct the schema from scratch
manually?

Thanks.



--
View this message in context: http://lucene.472066.n3.nabble.com/Use-XSD-or-DTD-to-make-Solr-schema-tp4135031.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Use XSD or DTD to make Solr schema?

Posted by Michael Sokolov <ms...@safaribooksonline.com>.
I'm pretty sure there's nothing to automate that task, but there are 
some tools to help with indexing XML.  Lux (http://luxdb.org) is one; it 
can index all the element text and attribute values, effectively 
creating an index for each tag name -- these are not specifically 
Solr/Lucene fields, but tagged tokens within a single field.  You can 
also create fields for XPath expressions that you specify, and then 
query these using XPath and XQuery.  There are also other XML-oriented 
tools built on Lucene, like eXist.  Compared to eXist, Lux is unique in 
that it is completely integrated with Solr and works side by side with it.

I believe there is a more conventional approach in a set of tools called 
DIH that includes XPath indexing capabilities but I'm not very familiar 
with that.

But I don't think any of these is schema (or DTD)-driven.

-Mike

On 5/6/2014 6:33 PM, paulparsons wrote:
> I'm new to Solr, so forgive me if this is a silly question. Although I can
> find some related information (in this list and elsewhere), I can't seem to
> find a clear answer to my specific question:
>
> If I have a DTD or XSD that describes the structure of a set of XML
> documents that I have, is there some way to convert that into the schema.xml
> that Solr requires? Or do I need to construct the schema from scratch
> manually?
>
> Thanks.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Use-XSD-or-DTD-to-make-Solr-schema-tp4135031.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Use XSD or DTD to make Solr schema?

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Solr's schema is mostly flat (though subdocuments are now allowed).
So, the complexity of an XML document need to be mapped to the flat
layout (unless you use Lux as mentioned).

Given the limitation, the use-case for DTD/XSD mappers is not very
strong. I guess it would be useful for type mapping (int->tinit, etc),
but I haven't seen anything that implements that idea.

Regards,
   Alex.
Personal website: http://www.outerthoughts.com/
Current project: http://www.solr-start.com/ - Accelerating your Solr proficiency


On Wed, May 7, 2014 at 5:33 AM, paulparsons <pa...@gmail.com> wrote:
> I'm new to Solr, so forgive me if this is a silly question. Although I can
> find some related information (in this list and elsewhere), I can't seem to
> find a clear answer to my specific question:
>
> If I have a DTD or XSD that describes the structure of a set of XML
> documents that I have, is there some way to convert that into the schema.xml
> that Solr requires? Or do I need to construct the schema from scratch
> manually?
>
> Thanks.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Use-XSD-or-DTD-to-make-Solr-schema-tp4135031.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Use XSD or DTD to make Solr schema?

Posted by Jack Krupansky <ja...@basetechnology.com>.
Sorry, but you have to create the schema manually, but... you could possibly 
get by with Solr schemaless mode to dynamically create the schema based on 
the actual data values.

See:
https://cwiki.apache.org/confluence/display/solr/Schemaless+Mode

-- Jack Krupansky

-----Original Message----- 
From: paulparsons
Sent: Tuesday, May 6, 2014 6:33 PM
To: solr-user@lucene.apache.org
Subject: Use XSD or DTD to make Solr schema?

I'm new to Solr, so forgive me if this is a silly question. Although I can
find some related information (in this list and elsewhere), I can't seem to
find a clear answer to my specific question:

If I have a DTD or XSD that describes the structure of a set of XML
documents that I have, is there some way to convert that into the schema.xml
that Solr requires? Or do I need to construct the schema from scratch
manually?

Thanks.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Use-XSD-or-DTD-to-make-Solr-schema-tp4135031.html
Sent from the Solr - User mailing list archive at Nabble.com.