lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [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
Date Tue, 14 Jun 2016 22:51:30 GMT

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

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

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

SOLR-8940: Fix group.sort option

(cherry picked from commit 18256fc2873f198e8e577c6eb0f337df1d1cda24)


> 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
>             Fix For: 6.1, master (7.0)
>
>         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


Mime
View raw message