You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2014/05/28 22:37:01 UTC

[jira] [Updated] (SOLR-6118) expand.sort doesn't work with function queries

     [ https://issues.apache.org/jira/browse/SOLR-6118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley updated SOLR-6118:
-------------------------------

    Attachment: SOLR-6118_expand_sort_rewrite.patch

Simple fix w/ test. I think I've been bitten by this type of bug before -- forgetting to call:
{code:java}
  if (sort != null)
    sort = sort.rewrite(searcher);
{code}

It'd be nice if somehow Lucene's Sort.java maintained a "rewritten" boolean flag so that a bug like this would have been caught earlier during development.  Maybe that's the solution, maybe not.

I noticed some indentation/spacing problems in ExpandComponent.java. I'll fix them in a separate commit.

> expand.sort doesn't work with function queries
> ----------------------------------------------
>
>                 Key: SOLR-6118
>                 URL: https://issues.apache.org/jira/browse/SOLR-6118
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.8
>            Reporter: David Smiley
>            Assignee: David Smiley
>         Attachments: SOLR-6118_expand_sort_rewrite.patch
>
>
> The new ExpandComponent doesn't support function queries in the {{expand.sort}} parameter, such as geodist() for example.  Here's the stack trace if you try:
> {noformat}
> 527561 [qtp1458849419-16] ERROR org.apache.solr.servlet.SolrDispatchFilter  – null:java.lang.IllegalStateException: SortField needs to be rewritten through Sort.rewrite(..) and SortField.rewrite(..)
> 	at org.apache.lucene.search.SortField.getComparator(SortField.java:433)
> 	at org.apache.lucene.search.FieldValueHitQueue$OneComparatorFieldValueHitQueue.<init>(FieldValueHitQueue.java:66)
> 	at org.apache.lucene.search.FieldValueHitQueue.create(FieldValueHitQueue.java:171)
> 	at org.apache.lucene.search.TopFieldCollector.create(TopFieldCollector.java:1133)
> 	at org.apache.lucene.search.TopFieldCollector.create(TopFieldCollector.java:1079)
> 	at org.apache.solr.handler.component.ExpandComponent$GroupExpandCollector.<init>(ExpandComponent.java:310)
> 	at org.apache.solr.handler.component.ExpandComponent.process(ExpandComponent.java:203)
> 	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:218)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1952)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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