Standard XML

The standard XML response writer is the most common and usable response writer in Solr.

Standard XML response writer parameters:

Parameter Behavior Default Value
version

The version parameter determines the XML protocol used in the response. The advantage of setting this parameter is that the response format remains the same even if the Solr version gets an upgrade.

The default value is the latest supported one. The only currently supported version value is 2.2.
stylesheet It includes a <?xml-stylesheet type="text/xsl" href="…​"?> declaration in the XML response. Solr does not return any style sheet declaration by default.
indent Indenting the XML response for a more human-readable format.

By default, Solr will not indent the XML response.

 

Example: Searching for query id=SP2514N and retrieving a response in XML format.

Solr admin console, searching for product id=SP2514N, and retrieving the response in XML format:

URL: http://localhost:8983/solr/techproducts/select?q=SP2514N&wt=xml

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
<lst name="params">
<str name="q">SP2514N</str>
<str name="wt">xml</str>
<str name="_">1514797189592</str>
</lst>
</lst>
<result name="response" numFound="1" start="0">
<doc>
<str name="id">SP2514N</str>
<str name="name">Samsung SpinPoint P120 SP2514N - hard drive - 250 GB - ATA-133</str>
<str name="manu">Samsung Electronics Co. Ltd.</str>
<str name="manu_id_s">samsung</str>
<arr name="cat">
<str>electronics</str>
<str>hard drive</str>
</arr>
<arr name="features">
<str>7200RPM, 8MB cache, IDE Ultra ATA-133</str>
<str>NoiseGuard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor</str>
</arr>
<float name="price">92.0</float>
<str name="price_c">92.0,USD</str>
<int name="popularity">6</int>
<bool name="inStock">true</bool>
<date name="manufacturedate_dt">2006-02-13T15:26:37Z</date>
<str name="store">35.0752,-97.032</str>
<long name="_version_">1583131913641525248</long>
<long name="price_c____l_ns">9200</long></doc>
</result>
</response>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.252.126