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

Dennis Gove commented on SOLR-8962:
-----------------------------------

Been giving this a bit of thought and I think I'm gonna go with the following 
approach.

By default this will use Java's standard Collections sort method which provides 
nlogn performance. If we also take into account the time to read all the tuples 
from the incoming sort into a List (currently thinking LinkedList because 
insertion is O(1) but I do want to confirm that sorting will still be done in 
nlogn with a linked list) then that cost is just n. Total time cost for the 
sort would be 2nlogn.

That said, there may be cases where a more performant sort, like counting sort, 
could be used. For those cases the stream will also accept an algorithm 
parameter asking for the use of a different sorting algorithm.

> Add sort Streaming Expression
> -----------------------------
>
>                 Key: SOLR-8962
>                 URL: https://issues.apache.org/jira/browse/SOLR-8962
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Joel Bernstein
>            Priority: Critical
>             Fix For: 6.1
>
>
> The sort Streaming Expression does an in memory sort of the Tuples returned 
> by it's underlying stream. This is intended to be used for sorting sets 
> gathered during local graph traversals. This will make it easy to gather sets 
> during a traversal and use all of the sort based set operations (merge, 
> innerJoin, outerJoin, reduce, complement, intersect). 
> This will be particularly useful with the gatherNodes expression (SOLR-8925). 
> Sample syntax:
> {code}
> intersect(
>        sort(gatherNodes(...), "fieldA asc"),
>        sort(gatherNodes(...), "fieldA asc"),
>        on)
> {code}



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

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

Reply via email to