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 Marc SCHNEIDER <ma...@gmail.com> on 2011/05/19 10:50:45 UTC
Special character in a field used by sort parameter
Hi,
I have a field called test-id but I can't use it when sorting, for example :
Doesn't work : ("undefined field test")
http://localhost:8180/solr/test-public/select/?q=test-id:1&sort=test-id+asc
http://localhost:8180/solr/test-public/select/?q=test-id:1&sort=test\-id+asc
When removing the sort parameter then it works...
Is there a way of escaping the field name in sort parameter?
Thanks in advance,
Marc.
Re: Special character in a field used by sort parameter
Posted by Joey <jo...@hotmail.com>.
Marc SCHNEIDER <marc.schneider73 <at> gmail.com> writes:
>
> Hi,
>
> I have a field called test-id but I can't use it when sorting, for example :
> Doesn't work : ("undefined field test")
> http://localhost:8180/solr/test-public/select/?q=test-id:1&sort=test-id+asc
> http://localhost:8180/solr/test-public/select/?q=test-id:1&sort=test\-id+asc
>
> When removing the sort parameter then it works...
>
> Is there a way of escaping the field name in sort parameter?
>
> Thanks in advance,
> Marc.
>
I've also got a similar issue. When the field name has a hyphen and the first
character is alphabetical, upon sorting solr says my field is undefined.
a) It sorts fine when the first character is numerical, and
b) I've tried encoding the url but hyphens don't encode.
If anyone has a fix, I would be stoked to hear it.
J
Re: Special character in a field used by sort parameter
Posted by Jan Høydahl <ja...@cominvent.com>.
Have you tried url-encoding? http://localhost:8180/solr/test-public/select/?q=test-id:1&sort=test%2Did+asc
--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
On 19. mai 2011, at 10.50, Marc SCHNEIDER wrote:
> Hi,
>
> I have a field called test-id but I can't use it when sorting, for example :
> Doesn't work : ("undefined field test")
> http://localhost:8180/solr/test-public/select/?q=test-id:1&sort=test-id+asc
> http://localhost:8180/solr/test-public/select/?q=test-id:1&sort=test\-id+asc
>
> When removing the sort parameter then it works...
>
> Is there a way of escaping the field name in sort parameter?
>
> Thanks in advance,
> Marc.