cpoerschke commented on a change in pull request #300: SOLR-11831: Skip second
grouping step if group.limit is 1 (aka Las Vegas Patch)
URL: https://github.com/apache/lucene-solr/pull/300#discussion_r293880060
##########
File path:
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
##########
@@ -232,6 +233,47 @@ public void prepare(ResponseBuilder rb) throws IOException
}
}
+ // check if prefix is a prefix of the array
+ private static boolean isPrefix(SortField[] prefix, SortField[] array){
Review comment:
Not sure. Yes, it's private and static but it seems a relatively long amount
of what seems quite generic code and when another class needs something like it
then it would be tricky to discover that the method already exists here and is
available for relocation?
Having looked around a little, it looks like there's a
[Collections.indexOfSubList](https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html#indexOfSubList-java.util.List-java.util.List-)
method in Java and if perhaps array-to-list conversion was acceptable then
something like
```
0 == Collections.indexOfSubList(Arrays.asList(array), Arrays.asList(prefix))
```
might be another alternative?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]