You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by JCodina <jo...@barcelonamedia.org> on 2010/03/03 10:18:25 UTC

error in sum function

the sum function or the map one are not parsed correctly,
doing this sort, works as a charm...
sort=score+desc,sum(Num,map(Num,0,2000,42000))+asc
but

sort=score+desc,sum(map(Num,0,2000,42000),Num)+asc

gives the following exception

SEVERE: org.apache.solr.common.SolrException: Must declare sort field or
function
        at
org.apache.solr.search.QueryParsing.processSort(QueryParsing.java:376)
        at
org.apache.solr.search.QueryParsing.parseSort(QueryParsing.java:281)
        at org.apache.solr.search.QParser.getSort(QParser.java:217)
        at
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:86)
        at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:174)
        at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)

you can test it in here using these two url's

http://varoitus.barcelonamedia.org:8180/fbm-ijec/select?indent=on&fl=id,Num,score&sort=score%20asc,sum%28map%28Num,0,5000,42000%29,Num%29+asc&q=+entities_org:%28%22Amena%22%29

http://varoitus.barcelonamedia.org:8180/fbm-ijec/select?indent=on&wt=php&fl=id,Num,score&rows=50&sort=score+desc,sum%28Num,map%28Num,0,2000,42000%29%29+asc&q=+entities_org:Amena




-- 
View this message in context: http://old.nabble.com/error-in-sum-function-tp27765881p27765881.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: error in sum function

Posted by JCodina <jo...@barcelonamedia.org>.

Ok, solved!!!

Joan

Koji Sekiguchi-2 wrote:
> 
> Can you try it latest trunk? I have just fixed it in a couple of days
> 
> Koji Sekiguchi from mobile
> 
> 
> On 2010/03/03, at 18:18, JCodina <jo...@barcelonamedia.org> wrote:
> 
>>
>> the sum function or the map one are not parsed correctly,
>> doing this sort, works as a charm...
>> sort=score+desc,sum(Num,map(Num,0,2000,42000))+asc
>> but
>>
>> sort=score+desc,sum(map(Num,0,2000,42000),Num)+asc
>>
>> gives the following exception
>>
>> SEVERE: org.apache.solr.common.SolrException: Must declare sort  
>> field or
>> function
>>        at
>> org.apache.solr.search.QueryParsing.processSort(QueryParsing.java:376)
>>        at
>> org.apache.solr.search.QueryParsing.parseSort(QueryParsing.java:281)
>>        at org.apache.solr.search.QParser.getSort(QParser.java:217)
>>        at
>> org.apache.solr.handler.component.QueryComponent.prepare 
>> (QueryComponent.java:86)
>>        at
>> org.apache.solr.handler.component.SearchHandler.handleRequestBody 
>> (SearchHandler.java:174)
>>        at
>> org.apache.solr.handler.RequestHandlerBase.handleRequest 
>> (RequestHandlerBase.java:131)
>>
>> you can test it in here using these two url's
>>
>> http://varoitus.barcelonamedia.org:8180/fbm-ijec/select?indent=on&fl=id,Num,score&sort=score%20asc,sum%28map%28Num,0,5000,42000%29,Num%29+asc&q=+entities_org:%28%22Amena%22%29
>>
>> http://varoitus.barcelonamedia.org:8180/fbm-ijec/select?indent=on&wt=php&fl=id,Num,score&rows=50&sort=score+desc,sum%28Num,map%28Num,0,2000,42000%29%29+asc&q=+entities_org:Amena
>>
>>
>>
>>
>> -- 
>> View this message in context:
>> http://old.nabble.com/error-in-sum-function-tp27765881p27765881.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/error-in-sum-function-tp27765881p27768877.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: error in sum function

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
Can you try it latest trunk? I have just fixed it in a couple of days

Koji Sekiguchi from mobile


On 2010/03/03, at 18:18, JCodina <jo...@barcelonamedia.org> wrote:

>
> the sum function or the map one are not parsed correctly,
> doing this sort, works as a charm...
> sort=score+desc,sum(Num,map(Num,0,2000,42000))+asc
> but
>
> sort=score+desc,sum(map(Num,0,2000,42000),Num)+asc
>
> gives the following exception
>
> SEVERE: org.apache.solr.common.SolrException: Must declare sort  
> field or
> function
>        at
> org.apache.solr.search.QueryParsing.processSort(QueryParsing.java:376)
>        at
> org.apache.solr.search.QueryParsing.parseSort(QueryParsing.java:281)
>        at org.apache.solr.search.QParser.getSort(QParser.java:217)
>        at
> org.apache.solr.handler.component.QueryComponent.prepare 
> (QueryComponent.java:86)
>        at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody 
> (SearchHandler.java:174)
>        at
> org.apache.solr.handler.RequestHandlerBase.handleRequest 
> (RequestHandlerBase.java:131)
>
> you can test it in here using these two url's
>
> http://varoitus.barcelonamedia.org:8180/fbm-ijec/select?indent=on&fl=id,Num,score&sort=score%20asc,sum%28map%28Num,0,5000,42000%29,Num%29+asc&q=+entities_org:%28%22Amena%22%29
>
> http://varoitus.barcelonamedia.org:8180/fbm-ijec/select?indent=on&wt=php&fl=id,Num,score&rows=50&sort=score+desc,sum%28Num,map%28Num,0,2000,42000%29%29+asc&q=+entities_org:Amena
>
>
>
>
> -- 
> View this message in context: http://old.nabble.com/error-in-sum-function-tp27765881p27765881.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>