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.

intersect(<br />

search(collection1, q=a_s:(setA || setAB), fl="id,a_s,a_i", sort="a_i asc, a_s<br />

asc"),<br />

search(collection1, q=a_s:(setB || setAB), fl="id,a_s,a_i", sort="a_i asc"),<br />

on="a_i"<br />

)<br />

intersect(<br />

search(collection1, q=a_s:(setA || setAB), fl="id,a_s,a_i", sort="a_i asc, a_s<br />

asc"),<br />

search(collection1, q=a_s:(setB || setAB), fl="id,a_s,a_i", sort="a_i asc, a_s<br />

asc"),<br />

on="a_i,a_s"<br />

)<br />

merge<br />

The merge function merges two or more streaming expressions and maintains the ordering of the underlying<br />

streams. Because the order is maintained, the sorts of the underlying streams must line up with the on parameter<br />

provided to the merge function.<br />

Parameters<br />

Syntax<br />

StreamExpression A<br />

StreamExpression B<br />

Optional StreamExpression C,D,....Z<br />

on: Sort criteria for performing the merge. Of the form fieldName order where order is asc or desc.<br />

Multiple fields can be provided in the form fieldA order, fieldB order.<br />

# Merging two stream expressions together<br />

merge(<br />

search(collection1,<br />

q="id:(0 3 4)",<br />

fl="id,a_s,a_i,a_f",<br />

sort="a_f asc"),<br />

search(collection1,<br />

q="id:(1)",<br />

fl="id,a_s,a_i,a_f",<br />

sort="a_f asc"),<br />

on="a_f asc")<br />

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

419

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

Saved successfully!

Ooh no, something went wrong!