You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/05/31 23:53:13 UTC

[jira] [Commented] (SOLR-8940) group.sort broken, can through AIOOBE if clause length differs from sort param, or cast exception if datatypes are incompatible with sort clause types

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

ASF subversion and git services commented on SOLR-8940:
-------------------------------------------------------

Commit 18256fc2873f198e8e577c6eb0f337df1d1cda24 in lucene-solr's branch refs/heads/master from Chris Hostetter
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=18256fc ]

SOLR-8940: Fix group.sort option


> group.sort broken, can through AIOOBE if clause length differs from sort param, or cast exception if datatypes are incompatible with sort clause types
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-8940
>                 URL: https://issues.apache.org/jira/browse/SOLR-8940
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 5.5, 5.5.1, 6.0, 6.0.1
>            Reporter: Henrik
>            Assignee: Hoss Man
>            Priority: Blocker
>              Labels: 5.5, arrayindexoutofbounds, exception, query, regression, search
>         Attachments: 0001-SOLR-8940-Avoid-ArrayIndexOutOfBoundsException-in-To.patch, SOLR-8940.patch, schema-types.xml, schema.xml, solr-query-exception.txt, solrconfig.xml
>
>
> We get an ArrayIndexOutOfBoundsException when searching after upgrading to solr 5.5.
> Here's the query:
> {code}
> "params":{
>       "q":"*:*",
>       "group.sort":"priceAmount asc,rnd desc",
>       "indent":"on",
>       "fl":"priceAmount,flightTripId,brand,slob,cabinType,tripDuration",
>       "group.limit":"100",
>       "fq":["searchId:e31a0c58-9056-4297-8d70-049017ba4906",
>         "doctype:offer",
>         "flightTripId:(DY6020421-SK2360519 OR DY6020421-SK2600519 OR DY6020421-SK2620519 OR DY6020421-SK2740519 OR DY6020421-SK2900519 OR DY6020421-SK2860519 OR DY6040421-SK2380519 OR DY6040421-SK2440519 OR DY6040421-SK2480519 OR DY6040421-SK2520519 OR DY6040421-SK2600519 OR DY6040421-SK2620519 OR DY6040421-SK2720519 OR DY6040421-SK2740519 OR DY6040421-SK2800519 OR DY6040421-SK2840519 OR DY6040421-SK2820519 OR DY6060421-SK2480519 OR DY6060421-SK2740519 OR DY6060421-SK2800519 OR DY6060421-SK2840519 OR DY6060421-SK2900519 OR DY6060421-SK2860519 OR DY6060421-SK2820519 OR DY6080421-SK2440519)",
>         "maximumLegDuration:[* TO 180]",
>         "departureAirportLeg1:(OSL)",
>         "(arrivalAirportLeg2:(OSL) OR (* NOT arrivalAirportLeg2:*))",
>         "arrivalAirportLeg1:(BGO)",
>         "(departureAirportLeg2:(BGO) OR (* NOT departureAirportLeg2:*))"],
>       "group.ngroups":"true",
>       "wt":"json",
>       "group.field":"flightTripId",
>       "group":"true"}}
> {code}
> And here's the exception:
> {code}
> ERROR [20160404T104846,333] qtp315138752-3037 org.apache.solr.servlet.HttpSolrCall - null:java.lang.ArrayIndexOutOfBoundsException: 1
>         at org.apache.solr.search.grouping.distributed.shardresultserializer.TopGroupsResultTransformer.transformToNativeShardDoc(TopGroupsResultTransformer.java:175)
>         at org.apache.solr.search.grouping.distributed.shardresultserializer.TopGroupsResultTransformer.transformToNative(TopGroupsResultTransformer.java:137)
>         at org.apache.solr.search.grouping.distributed.responseprocessor.TopGroupsShardResponseProcessor.process(TopGroupsShardResponseProcessor.java:129)
>         at org.apache.solr.handler.component.QueryComponent.handleGroupedResponses(QueryComponent.java:750)
>         at org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:733)
>         at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:405)
>         at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:155)
>         at org.apache.solr.core.SolrCore.execute(SolrCore.java:2082)
> {code}
> The exception is thrown at the last line here (TopGroupsResultTransformer.java line 175):
> {code}
>   protected ScoreDoc[] transformToNativeShardDoc(List<NamedList<Object>> documents, Sort groupSort, String shard,
>                                                  IndexSchema schema) {
>     [...]
>     for (NamedList<Object> document : documents) {
>       [...]
>       Object sortValuesVal = document.get("sortValues");
>       if (sortValuesVal != null) {
>         sortValues = ((List) sortValuesVal).toArray();
>         for (int k = 0; k < sortValues.length; k++) {
>           SchemaField field = groupSort.getSort()[k].getField() != null
>               ? schema.getFieldOrNull(groupSort.getSort()[k].getField()) : null;
> {code}
> It's not obvious to me that {{sortValues.length == groupSort.getSort().length}}, but I guess there's some logic behind it :)
> I have attached the schema and json result.
> The problem disappears when rolling back to 5.4.0.



--
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