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 "☼ 林永忠 ☼ (Yung-chung Lin)" <he...@gmail.com> on 2011/10/25 03:39:32 UTC

A sort-by-geodist question

Hi,

I've started to use Solr to build up a search service, but I have
encountered a problem here.

However, when I use this URL, it always returns "*sort param could not be
parsed as a query, and is not a field that exists in the index: geodist()"*
*
*
http://localhost:8080/solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist()%20asc<http://antlion.skimbl.com:8080/skimbl-solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist(45.15,-93.85)%20asc>

It works only when I specify coordinates in geodist().
http://localhost:8080/solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist(45.15,-93.85)%20asc<http://antlion.skimbl.com:8080/skimbl-solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist(45.15,-93.85)%20asc>

And the returned documents don't seem to be ranked by distance according to
the criteria.

My lucene is 3.4. The field 'coordinates' is in geohash format.

Can anyone here give me some pointers?

Thank you very much.

Yung-chung Lin

Re: A sort-by-geodist question

Posted by "☼ 林永忠 ☼ (Yung-chung Lin)" <he...@gmail.com>.
Hi,

Thanks for the reply. I switched to the location type. And it's working now.
Am not sure if it's a problem with geohash or it's because I don't know well
about the configurations, but it works now.

Thanks for the reply.

Yung-chung Lin

2011/10/26 Erick Erickson <er...@gmail.com>

> Hmmm, I'm not sure this is supported. Why can't you just use the "location"
> type
> provided in the example schema?
>
> Best
> Erick
>
> On Mon, Oct 24, 2011 at 9:39 PM, ☼ 林永忠 ☼ (Yung-chung Lin)
> <he...@gmail.com> wrote:
> > Hi,
> >
> > I've started to use Solr to build up a search service, but I have
> > encountered a problem here.
> >
> > However, when I use this URL, it always returns "*sort param could not be
> > parsed as a query, and is not a field that exists in the index:
> geodist()"*
> > *
> > *
> >
> http://localhost:8080/solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist()%20asc
> <
> http://antlion.skimbl.com:8080/skimbl-solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist(45.15,-93.85)%20asc
> >
> >
> > It works only when I specify coordinates in geodist().
> >
> http://localhost:8080/solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist(45.15,-93.85)%20asc
> <
> http://antlion.skimbl.com:8080/skimbl-solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist(45.15,-93.85)%20asc
> >
> >
> > And the returned documents don't seem to be ranked by distance according
> to
> > the criteria.
> >
> > My lucene is 3.4. The field 'coordinates' is in geohash format.
> >
> > Can anyone here give me some pointers?
> >
> > Thank you very much.
> >
> > Yung-chung Lin
> >
>

Re: A sort-by-geodist question

Posted by Erick Erickson <er...@gmail.com>.
Hmmm, I'm not sure this is supported. Why can't you just use the "location" type
provided in the example schema?

Best
Erick

On Mon, Oct 24, 2011 at 9:39 PM, ☼ 林永忠 ☼ (Yung-chung Lin)
<he...@gmail.com> wrote:
> Hi,
>
> I've started to use Solr to build up a search service, but I have
> encountered a problem here.
>
> However, when I use this URL, it always returns "*sort param could not be
> parsed as a query, and is not a field that exists in the index: geodist()"*
> *
> *
> http://localhost:8080/solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist()%20asc<http://antlion.skimbl.com:8080/skimbl-solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist(45.15,-93.85)%20asc>
>
> It works only when I specify coordinates in geodist().
> http://localhost:8080/solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist(45.15,-93.85)%20asc<http://antlion.skimbl.com:8080/skimbl-solr/select/?indent=true&fl=name,coordinates&q=*:*&sfield=coordinates&pt=45.15,-93.85&sort=geodist(45.15,-93.85)%20asc>
>
> And the returned documents don't seem to be ranked by distance according to
> the criteria.
>
> My lucene is 3.4. The field 'coordinates' is in geohash format.
>
> Can anyone here give me some pointers?
>
> Thank you very much.
>
> Yung-chung Lin
>