maedhroz commented on code in PR #4353:
URL: https://github.com/apache/cassandra/pull/4353#discussion_r2624944557


##########
src/java/org/apache/cassandra/index/sai/disk/v1/segment/IndexSegmentSearcher.java:
##########
@@ -84,6 +88,20 @@ else if (index.termType().isLiteral())
      */
     public abstract KeyRangeIterator search(Expression expression, 
AbstractBounds<PartitionPosition> keyRange, QueryContext queryContext) throws 
IOException;
 
+    /**
+     * Order the rows by the given expression.
+     *
+     * @param exp      the object containing the ordering logic
+     * @param keyRange key range specific in read command, used by ANN index
+     * @param context  to track per sstable cache and per query metrics
+     * @return an iterator of {@link PrimaryKeyWithScore} in descending score 
order
+     */
+    public CloseableIterator<PrimaryKeyWithScore> orderBy(Expression exp, 
AbstractBounds<PartitionPosition> keyRange, QueryContext context) throws 
IOException

Review Comment:
   nit: I'm not sure how much we want to bike-shed the naming of things. `ANN` 
is technically an `Expression`, but not in the sense that the other filters 
are. An "ordering" is an expression + direction, so this is almost that. 
Perhaps the direction is meaningless because nobody ever wants to get the 
"worst" scores. There's no directionality. Anyway, I'd be totally fine to call 
`exp` something like `ordering` if we feel like that helps communicate 
something about what we're doing here at the method signature level.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to