You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Joel Bernstein (JIRA)" <ji...@apache.org> on 2015/11/07 23:05:11 UTC

[jira] [Commented] (SOLR-7938) MergeStream to support N streams

    [ https://issues.apache.org/jira/browse/SOLR-7938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14995421#comment-14995421 ] 

Joel Bernstein commented on SOLR-7938:
--------------------------------------

Just reviewing the implementation for this ticket. Rather then having the MergeStream take a N streams we could have a MultiMergeStream that under the covers would loop over the streams and create compounded MergeStreams.

For example merging streams a,b and c could be expressed like this inside of the MultiMergeStream:

{code}
stream = new MergeStream(new MergeStream(a, c, comp), b, comp);
{code}

There's something kind of nice about this compounding of MergeStreams. 

The Expression would like this:
{code}
multiMerge(
  search(collection1, q="id:(0 4)", fl="id,a_s,a_i,a_f", sort="a_f asc, a_s asc"),
  search(collection1, q="id:(1)", fl="id,a_s,a_i,a_f", sort="a_f asc, a_s asc"),
  search(collection1, q="id:(2)", fl="id,a_s,a_i,a_f", sort="a_f asc, a_s asc"),
  on="a_f asc"
)
{code}



> MergeStream to support N streams
> --------------------------------
>
>                 Key: SOLR-7938
>                 URL: https://issues.apache.org/jira/browse/SOLR-7938
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ
>    Affects Versions: Trunk
>            Reporter: Dennis Gove
>            Priority: Minor
>              Labels: streaming
>         Attachments: SOLR-7938.patch
>
>
> Enhances MergeStream to support merging N streams. This was previously limited to merging just two streams but with this enhancement it can now accept any number of streams to merge.
> Based on the comparator, if more than one stream could provide the next value then the selected value will follow the order of the streams as they appear in the expression or were added to the MergeStream object.
> {code}
> merge(
>   search(collection1, q="id:(0 4)", fl="id,a_s,a_i,a_f", sort="a_f asc, a_s asc"),
>   search(collection1, q="id:(1)", fl="id,a_s,a_i,a_f", sort="a_f asc, a_s asc"),
>   search(collection1, q="id:(2)", fl="id,a_s,a_i,a_f", sort="a_f asc, a_s asc"),
>   on="a_f asc"
> )
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org