Vika - no, Solr's add-document XML syntax is not flexible in the way you've described. Solr fronts a Lucene index. A Lucene index is made up of Documents which have Fields. Fields are a flat structure, not hierarchical. The trick to leveraging Solr and Lucene successfully is in the mapping of the business domain into this flat structure.

Consider how queries to the system will be made. You may be fine just putting all searchable text into a single "text" field in Solr, for example. Or you may desire having individually searchable fields.

        Erik

On Jun 13, 2007, at 7:04 AM, Vikas wrote:

Hi Friends,

I am new to Solr technology. I want to do searching for xml documents. In source distribution examples of solr, we have same structure of XML documents i.e.
<add>
    <doc>
        <field></field>
        <field></field>
        .......
    </doc>
</add>

Can we change this structure of posting xml document?
i.e Can we do it like -->

<add>
    <doc>
        <field></field>
        <field></field>
            <student>
                <name>
                    <firstname>....</firstname>
                    <lastname>....</lastname>
                </name>
                <age>....</age>
                <sex>....</sex>
            </student>
    </doc>
</add>

Actually I have student.xml in above format. I want to do indexing and searching on student database which is in XML files.

With best regards

From
Vikas R. Khengare

Reply via email to