11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

To export the full sorted result set you'll want to use a request handler explicitly configured to only run the "query"<br />

component, using the the export "rq" and "wt" params.<br />

An "/export" request handler with the appropriate configuration is included in the techproducts example so<br />

lrconfig.xml. If however, you would like to add it to an existing solrconfig.xml, you can add a section like<br />

this:<br />

<br />

<br />

{!xport}<br />

xsort<br />

false<br />

<br />

<br />

query<br />

<br />

<br />

Note that this request handler's properties are defined as "invariants", which means they cannot be overridden by<br />

other properties passed at another time (such as at query time).<br />

Requesting Results Export<br />

Once the /export request handler is defined, you can use it to make requests to export the result set of a<br />

query.<br />

All queries must include sort and fl parameters, or the query will return an error. Filter queries are also<br />

supported. Results are always returned in JSON format.<br />

Here is an example of what an export request of some indexed log data might look like:<br />

http://localhost:8983/solr/core_name/export?q=my-query&sort=severity+desc,timestamp+<br />

desc&fl=severity,timestamp,msg<br />

Specifying the Sort Criteria<br />

The sort property defines how documents will be sorted in the exported result set. Results can be sorted by any<br />

field that has a field type of int,long, float, double, string. The sort fields must be single valued fields.<br />

Up to four sort fields can be specified per request, with the 'asc' or 'desc' properties.<br />

Specifying the Field List<br />

The fl property defines the fields that will be exported with the result set. Any of the field types that can be<br />

sorted (i.e., int, long, float, double, string) can be used in the field list. The fields can be single or multi-valued.<br />

However, returning scores and wildcards are not supported at this time.<br />

Distributed Support<br />

So Streaming Expression for distributed support.<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

405

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!