Re: spatial search, geofilt does not work

2013-08-20 Thread David Smiley (@MITRE.org)
Technically, the query was valid in that it parsed.  If it didn't parse then
you'd get an error.  If the notion of a "default field" didn't exist, and I
wish it didn't, then you would most certainly have gotten an error.  Perhaps
you are using the defaultSearchField feature in the schema; please don't --
your conundrum here shows how it can be a problem.  Or perhaps you used 'df'
as a request parameter -- again, same issue.  When I (rarely) use 'df', I
use it as a local-param.

~ David


Mingfeng Yang wrote
> Oh, man.  I have been trying to figure out the problem for half day.
>  Probably Solr could use some error msg if the query format is invalid.
> 
> But, THANKS! David, you probably saved me another half day.
> 
> Ming-
> 
> 
> 
> On Mon, Aug 19, 2013 at 10:20 PM, David Smiley (@MITRE.org) <

> DSMILEY@

>> wrote:
> 
>> Thank goodness for Solr's feature of echo'ing params back in the response
>> as
>> it helps diagnose problems like this.  In your case, the filter query
>> that
>> Solr is seeing isn't what you (seemed) to have given on the command line:
>> "fq":"!geofilt sfield=author_geo"
>> Clearly wrong.  Try escaping the braces with URL percent escapes, etc.
>>
>> ~ David
>>
>>
>> Mingfeng Yang wrote
>> > My solr index has a field called "author_geo" which contains the
>> author's
>> > location, and when I am trying to get all docs whose author are within
>> 10
>> > km of 35.0,35.0 using the following query.
>> >
>> > curl '
>> >
>> http://localhost/solr/select?q=*:*&fq={!geofilt%20sfield=author_geo}&pt=35.0,35.0&d=10&wt=json&indent=true&fl=author_geo
>> > '
>> >
>> > I got one "match" document which actually has no value of author_geo.
>> >
>> > {
>> >   "responseHeader":{
>> > "status":0,
>> > "QTime":7,
>> > "params":{
>> >   "d":"10",
>> >   "fl":"author_geo",
>> >   "indent":"true",
>> >   "q":"*:*",
>> >   "pt":"35.0,35.0",
>> >   "wt":"json",
>> >   "fq":"!geofilt sfield=author_geo"}},
>> >   "response":{"numFound":1,"start":0,"maxScore":1.0,"docs":[
>> >   {}]
>> >   }}
>> >
>> >
>> > But if I run the following query to do a sorting, it shows clearly that
>> > there are at least 6 docs which are within 10km of 35.0,35.0.
>> >
>> > curl '
>> >
>> http://localhost/solr/select?q=*:*&sort=geodist(author_geo,35,35)+asc&wt=json&indent=true&fl=author_geo,geodist(author_geo,35,35)&fq=author_geo
>> > :\[0,0%20TO%20360,360\]'
>> >
>> > {
>> >   "responseHeader":{
>> > "status":0,
>> > "QTime":10,
>> > "params":{
>> >   "fl":"author_geo,geodist(author_geo,35,35)",
>> >   "sort":"geodist(author_geo,35,35) asc",
>> >   "indent":"true",
>> >   "q":"*:*",
>> >   "wt":"json",
>> >   "fq":"author_geo:[0,0 TO 360,360]"}},
>> >   "response":{"numFound":78133,"start":0,"docs":[
>> >   {
>> > "author_geo":"34.991199,34.991199",
>> > "geodist(author_geo,35,35)":1.2650756688780775},
>> >   {
>> > "author_geo":"34.991199,34.991199",
>> > "geodist(author_geo,35,35)":1.2650756688780775},
>> >   {
>> >     "author_geo":"34.991199,34.991199",
>> > "geodist(author_geo,35,35)":1.2650756688780775},
>> >   {
>> > "author_geo":"35.032242,35.032242",
>> >     "geodist(author_geo,35,35)":4.634071252404282},
>> >   {
>> > "author_geo":"35.04644,35.04644",
>> > "geodist(author_geo,35,35)":6.674485609316976},
>> >   {
>> > "author_geo":"35.060379,35.060379",
>> > "geodist(author_geo,35,35)":8.67754019129343},
>> >   {
>> > "author_geo":"34.924019,34.924019",
>> > "geodist(author_geo,35,35)":10.923479728441448},
>> >   {
>> > "author_geo":"34.89296,34.89296",
>> > "geodist(author_geo,35,35)":15.389876355902395},
>> >   {
>> > "author_geo":"34.89296,34.89296",
>> > "geodist(author_geo,35,35)":15.389876355902395},
>> >   {
>> > "author_geo":"35.109669,35.109669",
>> > "geodist(author_geo,35,35)":15.759483283896515}]
>> >   }}
>> >
>> > Can anyone tell me if anything is wrong here?  I am using Solr 4.4.
>> >
>> > Thanks,
>> > Ming-
>>
>>
>>
>>
>>
>> -
>>  Author:
>> http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/spatial-search-geofilt-does-not-work-tp4085551p4085590.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>





-
 Author: http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
--
View this message in context: 
http://lucene.472066.n3.nabble.com/spatial-search-geofilt-does-not-work-tp4085551p4085781.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: spatial search, geofilt does not work

2013-08-20 Thread Mingfeng Yang
Oh, man.  I have been trying to figure out the problem for half day.
 Probably Solr could use some error msg if the query format is invalid.

But, THANKS! David, you probably saved me another half day.

Ming-



On Mon, Aug 19, 2013 at 10:20 PM, David Smiley (@MITRE.org) <
dsmi...@mitre.org> wrote:

> Thank goodness for Solr's feature of echo'ing params back in the response
> as
> it helps diagnose problems like this.  In your case, the filter query that
> Solr is seeing isn't what you (seemed) to have given on the command line:
> "fq":"!geofilt sfield=author_geo"
> Clearly wrong.  Try escaping the braces with URL percent escapes, etc.
>
> ~ David
>
>
> Mingfeng Yang wrote
> > My solr index has a field called "author_geo" which contains the author's
> > location, and when I am trying to get all docs whose author are within 10
> > km of 35.0,35.0 using the following query.
> >
> > curl '
> >
> http://localhost/solr/select?q=*:*&fq={!geofilt%20sfield=author_geo}&pt=35.0,35.0&d=10&wt=json&indent=true&fl=author_geo
> > '
> >
> > I got one "match" document which actually has no value of author_geo.
> >
> > {
> >   "responseHeader":{
> > "status":0,
> > "QTime":7,
> > "params":{
> >   "d":"10",
> >   "fl":"author_geo",
> >   "indent":"true",
> >   "q":"*:*",
> >   "pt":"35.0,35.0",
> >   "wt":"json",
> >   "fq":"!geofilt sfield=author_geo"}},
> >   "response":{"numFound":1,"start":0,"maxScore":1.0,"docs":[
> >   {}]
> >   }}
> >
> >
> > But if I run the following query to do a sorting, it shows clearly that
> > there are at least 6 docs which are within 10km of 35.0,35.0.
> >
> > curl '
> >
> http://localhost/solr/select?q=*:*&sort=geodist(author_geo,35,35)+asc&wt=json&indent=true&fl=author_geo,geodist(author_geo,35,35)&fq=author_geo
> > :\[0,0%20TO%20360,360\]'
> >
> > {
> >   "responseHeader":{
> > "status":0,
> > "QTime":10,
> > "params":{
> >   "fl":"author_geo,geodist(author_geo,35,35)",
> >   "sort":"geodist(author_geo,35,35) asc",
> >   "indent":"true",
> >   "q":"*:*",
> >   "wt":"json",
> >   "fq":"author_geo:[0,0 TO 360,360]"}},
> >   "response":{"numFound":78133,"start":0,"docs":[
> >   {
> > "author_geo":"34.991199,34.991199",
> > "geodist(author_geo,35,35)":1.2650756688780775},
> >   {
> > "author_geo":"34.991199,34.991199",
> > "geodist(author_geo,35,35)":1.2650756688780775},
> >   {
> > "author_geo":"34.991199,34.991199",
> > "geodist(author_geo,35,35)":1.2650756688780775},
> >   {
> > "author_geo":"35.032242,35.032242",
> >     "geodist(author_geo,35,35)":4.634071252404282},
> >   {
> > "author_geo":"35.04644,35.04644",
> > "geodist(author_geo,35,35)":6.674485609316976},
> >   {
> > "author_geo":"35.060379,35.060379",
> > "geodist(author_geo,35,35)":8.67754019129343},
> >   {
> > "author_geo":"34.924019,34.924019",
> > "geodist(author_geo,35,35)":10.923479728441448},
> >   {
> > "author_geo":"34.89296,34.89296",
> > "geodist(author_geo,35,35)":15.389876355902395},
> >   {
> > "author_geo":"34.89296,34.89296",
> > "geodist(author_geo,35,35)":15.389876355902395},
> >   {
> > "author_geo":"35.109669,35.109669",
> > "geodist(author_geo,35,35)":15.759483283896515}]
> >   }}
> >
> > Can anyone tell me if anything is wrong here?  I am using Solr 4.4.
> >
> > Thanks,
> > Ming-
>
>
>
>
>
> -
>  Author:
> http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/spatial-search-geofilt-does-not-work-tp4085551p4085590.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: spatial search, geofilt does not work

2013-08-19 Thread David Smiley (@MITRE.org)
Thank goodness for Solr's feature of echo'ing params back in the response as
it helps diagnose problems like this.  In your case, the filter query that
Solr is seeing isn't what you (seemed) to have given on the command line:
"fq":"!geofilt sfield=author_geo"
Clearly wrong.  Try escaping the braces with URL percent escapes, etc.

~ David


Mingfeng Yang wrote
> My solr index has a field called "author_geo" which contains the author's
> location, and when I am trying to get all docs whose author are within 10
> km of 35.0,35.0 using the following query.
> 
> curl '
> http://localhost/solr/select?q=*:*&fq={!geofilt%20sfield=author_geo}&pt=35.0,35.0&d=10&wt=json&indent=true&fl=author_geo
> '
> 
> I got one "match" document which actually has no value of author_geo.
> 
> {
>   "responseHeader":{
> "status":0,
> "QTime":7,
> "params":{
>   "d":"10",
>   "fl":"author_geo",
>   "indent":"true",
>   "q":"*:*",
>   "pt":"35.0,35.0",
>   "wt":"json",
>   "fq":"!geofilt sfield=author_geo"}},
>   "response":{"numFound":1,"start":0,"maxScore":1.0,"docs":[
>   {}]
>   }}
> 
> 
> But if I run the following query to do a sorting, it shows clearly that
> there are at least 6 docs which are within 10km of 35.0,35.0.
> 
> curl '
> http://localhost/solr/select?q=*:*&sort=geodist(author_geo,35,35)+asc&wt=json&indent=true&fl=author_geo,geodist(author_geo,35,35)&fq=author_geo
> :\[0,0%20TO%20360,360\]'
> 
> {
>   "responseHeader":{
> "status":0,
> "QTime":10,
> "params":{
>   "fl":"author_geo,geodist(author_geo,35,35)",
>   "sort":"geodist(author_geo,35,35) asc",
>   "indent":"true",
>   "q":"*:*",
>   "wt":"json",
>   "fq":"author_geo:[0,0 TO 360,360]"}},
>   "response":{"numFound":78133,"start":0,"docs":[
>   {
> "author_geo":"34.991199,34.991199",
> "geodist(author_geo,35,35)":1.2650756688780775},
>   {
> "author_geo":"34.991199,34.991199",
> "geodist(author_geo,35,35)":1.2650756688780775},
>   {
> "author_geo":"34.991199,34.991199",
> "geodist(author_geo,35,35)":1.2650756688780775},
>   {
> "author_geo":"35.032242,35.032242",
> "geodist(author_geo,35,35)":4.634071252404282},
>   {
> "author_geo":"35.04644,35.04644",
>     "geodist(author_geo,35,35)":6.674485609316976},
>   {
> "author_geo":"35.060379,35.060379",
> "geodist(author_geo,35,35)":8.67754019129343},
>   {
> "author_geo":"34.924019,34.924019",
> "geodist(author_geo,35,35)":10.923479728441448},
>   {
> "author_geo":"34.89296,34.89296",
> "geodist(author_geo,35,35)":15.389876355902395},
>   {
> "author_geo":"34.89296,34.89296",
> "geodist(author_geo,35,35)":15.389876355902395},
>   {
> "author_geo":"35.109669,35.109669",
> "geodist(author_geo,35,35)":15.759483283896515}]
>   }}
> 
> Can anyone tell me if anything is wrong here?  I am using Solr 4.4.
> 
> Thanks,
> Ming-





-
 Author: http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
--
View this message in context: 
http://lucene.472066.n3.nabble.com/spatial-search-geofilt-does-not-work-tp4085551p4085590.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: spatial search, geofilt does not work

2013-08-19 Thread Mingfeng Yang
BTW: my schema.xml contains the following related lines.






On Mon, Aug 19, 2013 at 2:02 PM, Mingfeng Yang wrote:

> My solr index has a field called "author_geo" which contains the author's
> location, and when I am trying to get all docs whose author are within 10
> km of 35.0,35.0 using the following query.
>
> curl '
> http://localhost/solr/select?q=*:*&fq={!geofilt%20sfield=author_geo}&pt=35.0,35.0&d=10&wt=json&indent=true&fl=author_geo
> '
>
> I got one "match" document which actually has no value of author_geo.
>
> {
>   "responseHeader":{
> "status":0,
> "QTime":7,
> "params":{
>   "d":"10",
>   "fl":"author_geo",
>   "indent":"true",
>   "q":"*:*",
>   "pt":"35.0,35.0",
>   "wt":"json",
>   "fq":"!geofilt sfield=author_geo"}},
>   "response":{"numFound":1,"start":0,"maxScore":1.0,"docs":[
>   {}]
>   }}
>
>
> But if I run the following query to do a sorting, it shows clearly that
> there are at least 6 docs which are within 10km of 35.0,35.0.
>
> curl '
> http://localhost/solr/select?q=*:*&sort=geodist(author_geo,35,35)+asc&wt=json&indent=true&fl=author_geo,geodist(author_geo,35,35)&fq=author_geo
> :\[0,0%20TO%20360,360\]'
>
> {
>   "responseHeader":{
> "status":0,
> "QTime":10,
> "params":{
>   "fl":"author_geo,geodist(author_geo,35,35)",
>   "sort":"geodist(author_geo,35,35) asc",
>   "indent":"true",
>   "q":"*:*",
>   "wt":"json",
>   "fq":"author_geo:[0,0 TO 360,360]"}},
>   "response":{"numFound":78133,"start":0,"docs":[
>   {
> "author_geo":"34.991199,34.991199",
> "geodist(author_geo,35,35)":1.2650756688780775},
>   {
> "author_geo":"34.991199,34.991199",
> "geodist(author_geo,35,35)":1.2650756688780775},
>   {
> "author_geo":"34.991199,34.991199",
> "geodist(author_geo,35,35)":1.2650756688780775},
>   {
> "author_geo":"35.032242,35.032242",
> "geodist(author_geo,35,35)":4.634071252404282},
>   {
> "author_geo":"35.04644,35.04644",
> "geodist(author_geo,35,35)":6.674485609316976},
>   {
> "author_geo":"35.060379,35.060379",
> "geodist(author_geo,35,35)":8.67754019129343},
>   {
> "author_geo":"34.924019,34.924019",
> "geodist(author_geo,35,35)":10.923479728441448},
>   {
> "author_geo":"34.89296,34.89296",
> "geodist(author_geo,35,35)":15.389876355902395},
>   {
> "author_geo":"34.89296,34.89296",
> "geodist(author_geo,35,35)":15.389876355902395},
>   {
> "author_geo":"35.109669,35.109669",
> "geodist(author_geo,35,35)":15.759483283896515}]
>   }}
>
> Can anyone tell me if anything is wrong here?  I am using Solr 4.4.
>
> Thanks,
> Ming-
>
>


spatial search, geofilt does not work

2013-08-19 Thread Mingfeng Yang
My solr index has a field called "author_geo" which contains the author's
location, and when I am trying to get all docs whose author are within 10
km of 35.0,35.0 using the following query.

curl '
http://localhost/solr/select?q=*:*&fq={!geofilt%20sfield=author_geo}&pt=35.0,35.0&d=10&wt=json&indent=true&fl=author_geo
'

I got one "match" document which actually has no value of author_geo.

{
  "responseHeader":{
"status":0,
"QTime":7,
"params":{
  "d":"10",
  "fl":"author_geo",
  "indent":"true",
  "q":"*:*",
  "pt":"35.0,35.0",
  "wt":"json",
  "fq":"!geofilt sfield=author_geo"}},
  "response":{"numFound":1,"start":0,"maxScore":1.0,"docs":[
  {}]
  }}


But if I run the following query to do a sorting, it shows clearly that
there are at least 6 docs which are within 10km of 35.0,35.0.

curl '
http://localhost/solr/select?q=*:*&sort=geodist(author_geo,35,35)+asc&wt=json&indent=true&fl=author_geo,geodist(author_geo,35,35)&fq=author_geo
:\[0,0%20TO%20360,360\]'

{
  "responseHeader":{
"status":0,
"QTime":10,
"params":{
  "fl":"author_geo,geodist(author_geo,35,35)",
  "sort":"geodist(author_geo,35,35) asc",
  "indent":"true",
  "q":"*:*",
  "wt":"json",
  "fq":"author_geo:[0,0 TO 360,360]"}},
  "response":{"numFound":78133,"start":0,"docs":[
  {
"author_geo":"34.991199,34.991199",
"geodist(author_geo,35,35)":1.2650756688780775},
  {
"author_geo":"34.991199,34.991199",
"geodist(author_geo,35,35)":1.2650756688780775},
  {
"author_geo":"34.991199,34.991199",
"geodist(author_geo,35,35)":1.2650756688780775},
  {
"author_geo":"35.032242,35.032242",
"geodist(author_geo,35,35)":4.634071252404282},
  {
"author_geo":"35.04644,35.04644",
"geodist(author_geo,35,35)":6.674485609316976},
  {
"author_geo":"35.060379,35.060379",
"geodist(author_geo,35,35)":8.67754019129343},
  {
"author_geo":"34.924019,34.924019",
"geodist(author_geo,35,35)":10.923479728441448},
  {
"author_geo":"34.89296,34.89296",
"geodist(author_geo,35,35)":15.389876355902395},
  {
"author_geo":"34.89296,34.89296",
"geodist(author_geo,35,35)":15.389876355902395},
  {
"author_geo":"35.109669,35.109669",
"geodist(author_geo,35,35)":15.759483283896515}]
  }}

Can anyone tell me if anything is wrong here?  I am using Solr 4.4.

Thanks,
Ming-