Re: Getting the error - The field '*********' does not support spatial filtering

2018-02-19 Thread Erick Erickson
bq:  I was able to get it to work with after I removed my schema.xml
and modified the managed-schema to add my fields

That's fine. You have three options and they can be confusing:
1> use classic schema (i.e. schema.xml). Requires that you replace the
managed schema definition with classic in solrcofnig.xml, it'll look
something like:
 

2> use managed scheama

2a> without "field guessing". In this mode you take out stuff like
"add-unknown-fields-to-the-schema" in solrconfig.xml (really the
chain). You can hand-edit the managed-schema file freely. HOWEVER, you
should be very controlled when mixing hand-editing the managed-schema
file with using the managed-schema API to modify it. The
managed-schema API will overwrite the config with whatever is in
memory so your hand-edits may be lost.

2b> Allow Solr to try to infer fields based on the first one
encountered, "schemaless mode". This is the _default config in 7x.

See the "Schema Factory Definition in SolrConfig" section of the
reference guide.

Best,
Erick

On Mon, Feb 19, 2018 at 5:28 AM, Aakanksha Gupta
 wrote:
> Thanks David. That was helpful. I was able to get it to work with after I
> removed my schema.xml and modified the managed-schema to add my fields. I'm
> not sure if this is the right thing to do, but this is how I got it to work
> :)
>
> On Mon, Feb 19, 2018 at 7:54 AM, Howe, David 
> wrote:
>
>> Hi Aakanksha,
>>
>>
>>
>> We use the following for geo queries which works for us:
>>
>>
>>
>> /solr/core/select?defType=edismax&indent=on&ps=0&start=
>> 0&wt=json&sow=true&hl=on&hl.fl=*&fq=%7B!geofilt%7D&pt=-6.
>> 08165,145.8612430&d=10&sfield=geoLocation&sort=geodist()%
>> 20asc&rows=10&fl=*,score,distance:geodist()
>>
>>
>>
>> This gives us the results closest to the provided point in order of their
>> distance from the point.
>>
>>
>>
>> Our field definition is:
>>
>>
>>
>>   echo "$(date) Creating geoLocation field"
>>
>>   curl -X POST -H 'Content-type:application/json' --data-binary '{
>>
>> "add-field":{
>>
>>"name":"geoLocation",
>>
>>"type":"location",
>>
>>"stored":true,
>>
>>"indexed":true
>>
>> }
>>
>>   }' http://localhost:8983/solr/core/schema
>>
>>
>>
>> We are running Solr 7.1.0.
>>
>>
>>
>> Hope this helps.
>>
>>
>>
>> Regards,
>>
>>
>>
>> David
>>
>>
>>
>>
>>
>> *From:* Aakanksha Gupta [mailto:aakankshagupta2...@gmail.com]
>> *Sent:* Monday, 19 February 2018 12:27 AM
>> *To:* solr-user@lucene.apache.org
>> *Subject:* Getting the error - The field '*' does not support
>> spatial filtering
>>
>>
>>
>> Hi all,
>>
>> I'm a newbie to Solr. I'm trying to use it for GeoSpatial Search and I'm
>> facing an issue while using it. I've tried using the new 'location' field
>> type(> docValues="true"/>) as well as the deprecated solr.LatLonType fieldtype,
>> but I always get the error:
>>
>>
>> org.apache.solr.common.SolrException: The field latlong does not support 
>> spatial filtering
>>
>> Here's a snippet of my field definition in schema.xml in the conf folder
>> of my core:
>>
>> > required="true" multiValued="false" />
>> 
>> 
>> > docValues="false" />
>> > multiValued="true"/>
>> 
>> 
>> 
>> 
>> 
>> > stored="true" />
>> > stored="true" />
>>
>> And here are the field type definitions:
>> > subFieldSuffix="_coordinate"/>
>> > docValues="true"/>
>>
>> Here's the Query I'm running:
>> http://localhost:8983/solr/geo2/select?wt=json&q=:&fq={!geofilt
>> sfield=latlong}&pt=-6.08165,145.8612430&d=100
>>
>> http://localhost:8983/solr/geo2/select/?q=*:*&fq={!
>> geofilt}&sfield=latlong2&pt=-6.08165,145.8612430&d=100&wt=json
>>
>> And here's the Java snippet I'm using to insert data:
>> String urlString = "http://localhost:8983/solr/geo2";;
>> SolrClient solr = new HttpSolrClient.Builder(urlString).build();
>> SolrInputDocument document = new SolrInputDocument();
>> document.addField("id", UUID.randomUUID().toString());
>> document.addField("driverid", "1");
>> document.addField("latlong", "-6.081689,145.391881");
>> document.addField("time", "7:01:17");
>> document.addField("timestamp", Long.valueOf("1518908477190"));
>> document.addField("latlong2", "-6.081689,145.391881");
>> document.addField("location_0_coordinate",
>> Double.valueOf(-6.081689));
>> document.addField("location_1_coordinate",
>> Double.valueOf(145.391881));
>> UpdateResponse response = solr.add(document);
>> solr.commit();
>> response.getQTime();
>>
>>
>>
>> I've attached my schema.xml file herewith. Can someone let me know what
>> I'm doing wrong?
>>
>>
>>
>> David Howe
>> Java Domain Architect
>> Postal Systems
>> Australia Post
>>
>> Level 16, 111 Bourke Street
>> 
>> Melbourne
>> 

Re: Getting the error - The field '*********' does not support spatial filtering

2018-02-19 Thread Aakanksha Gupta
Thanks David. That was helpful. I was able to get it to work with after I
removed my schema.xml and modified the managed-schema to add my fields. I'm
not sure if this is the right thing to do, but this is how I got it to work
:)

On Mon, Feb 19, 2018 at 7:54 AM, Howe, David 
wrote:

> Hi Aakanksha,
>
>
>
> We use the following for geo queries which works for us:
>
>
>
> /solr/core/select?defType=edismax&indent=on&ps=0&start=
> 0&wt=json&sow=true&hl=on&hl.fl=*&fq=%7B!geofilt%7D&pt=-6.
> 08165,145.8612430&d=10&sfield=geoLocation&sort=geodist()%
> 20asc&rows=10&fl=*,score,distance:geodist()
>
>
>
> This gives us the results closest to the provided point in order of their
> distance from the point.
>
>
>
> Our field definition is:
>
>
>
>   echo "$(date) Creating geoLocation field"
>
>   curl -X POST -H 'Content-type:application/json' --data-binary '{
>
> "add-field":{
>
>"name":"geoLocation",
>
>"type":"location",
>
>"stored":true,
>
>"indexed":true
>
> }
>
>   }' http://localhost:8983/solr/core/schema
>
>
>
> We are running Solr 7.1.0.
>
>
>
> Hope this helps.
>
>
>
> Regards,
>
>
>
> David
>
>
>
>
>
> *From:* Aakanksha Gupta [mailto:aakankshagupta2...@gmail.com]
> *Sent:* Monday, 19 February 2018 12:27 AM
> *To:* solr-user@lucene.apache.org
> *Subject:* Getting the error - The field '*' does not support
> spatial filtering
>
>
>
> Hi all,
>
> I'm a newbie to Solr. I'm trying to use it for GeoSpatial Search and I'm
> facing an issue while using it. I've tried using the new 'location' field
> type( docValues="true"/>) as well as the deprecated solr.LatLonType fieldtype,
> but I always get the error:
>
>
> org.apache.solr.common.SolrException: The field latlong does not support 
> spatial filtering
>
> Here's a snippet of my field definition in schema.xml in the conf folder
> of my core:
>
>  required="true" multiValued="false" />
> 
> 
>  docValues="false" />
>  multiValued="true"/>
> 
> 
> 
> 
> 
>  stored="true" />
>  stored="true" />
>
> And here are the field type definitions:
>  subFieldSuffix="_coordinate"/>
>  docValues="true"/>
>
> Here's the Query I'm running:
> http://localhost:8983/solr/geo2/select?wt=json&q=:&fq={!geofilt
> sfield=latlong}&pt=-6.08165,145.8612430&d=100
>
> http://localhost:8983/solr/geo2/select/?q=*:*&fq={!
> geofilt}&sfield=latlong2&pt=-6.08165,145.8612430&d=100&wt=json
>
> And here's the Java snippet I'm using to insert data:
> String urlString = "http://localhost:8983/solr/geo2";;
> SolrClient solr = new HttpSolrClient.Builder(urlString).build();
> SolrInputDocument document = new SolrInputDocument();
> document.addField("id", UUID.randomUUID().toString());
> document.addField("driverid", "1");
> document.addField("latlong", "-6.081689,145.391881");
> document.addField("time", "7:01:17");
> document.addField("timestamp", Long.valueOf("1518908477190"));
> document.addField("latlong2", "-6.081689,145.391881");
> document.addField("location_0_coordinate",
> Double.valueOf(-6.081689));
> document.addField("location_1_coordinate",
> Double.valueOf(145.391881));
> UpdateResponse response = solr.add(document);
> solr.commit();
> response.getQTime();
>
>
>
> I've attached my schema.xml file herewith. Can someone let me know what
> I'm doing wrong?
>
>
>
> David Howe
> Java Domain Architect
> Postal Systems
> Australia Post
>
> Level 16, 111 Bourke Street
> 
> Melbourne
> 
> VIC
> 
> 3000
> 
>
> T  0391067904
>
> M 0424036591
>
> E  david.h...@auspost.com.au
> [image: Australia Post website] 
> [image: StarTrack website] 
> [image: Follow us on Twitter]  [image: Like
> us on Facebook]  [image: Connect
> with us on LinkedIn] 
>
> Australia Post is committed to providing our customers with excellent
> service. If we can assist you in any way please telephone 13 13 18 or visit
> our website.
>
> The information contained in this email communication may be proprietary,
> confidential or legally professionally privileged. It is intended
> exclusively for the individual or entity to which it is addressed. You
> should only read, disclose, re-transmit, copy, distribute, act in reliance
> on or commercialise the information if you are authorised to do so.
> Australia Post does not represent, warrant or guaran

RE: Getting the error - The field '*********' does not support spatial filtering

2018-02-18 Thread Howe, David
Hi Aakanksha,

We use the following for geo queries which works for us:

/solr/core/select?defType=edismax&indent=on&ps=0&start=0&wt=json&sow=true&hl=on&hl.fl=*&fq=%7B!geofilt%7D&pt=-6.08165,145.8612430&d=10&sfield=geoLocation&sort=geodist()%20asc&rows=10&fl=*,score,distance:geodist()

This gives us the results closest to the provided point in order of their 
distance from the point.

Our field definition is:

  echo "$(date) Creating geoLocation field"
  curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{
   "name":"geoLocation",
   "type":"location",
   "stored":true,
   "indexed":true
}
  }' http://localhost:8983/solr/core/schema

We are running Solr 7.1.0.

Hope this helps.

Regards,

David


From: Aakanksha Gupta [mailto:aakankshagupta2...@gmail.com]
Sent: Monday, 19 February 2018 12:27 AM
To: solr-user@lucene.apache.org
Subject: Getting the error - The field '*' does not support spatial 
filtering

Hi all,
I'm a newbie to Solr. I'm trying to use it for GeoSpatial Search and I'm facing 
an issue while using it. I've tried using the new 'location' field 
type() as well as the deprecated solr.LatLonType fieldtype, but I 
always get the error:



org.apache.solr.common.SolrException: The field latlong does not support 
spatial filtering
Here's a snippet of my field definition in schema.xml in the conf folder of my 
core:














And here are the field type definitions:


Here's the Query I'm running:
http://localhost:8983/solr/geo2/select?wt=json&q=:&fq={!geofilt
 sfield=latlong}&pt=-6.08165,145.8612430&d=100

http://localhost:8983/solr/geo2/select/?q=*:*&fq={!geofilt}&sfield=latlong2&pt=-6.08165,145.8612430&d=100&wt=json
And here's the Java snippet I'm using to insert data:
String urlString = "http://localhost:8983/solr/geo2";;
SolrClient solr = new HttpSolrClient.Builder(urlString).build();
SolrInputDocument document = new SolrInputDocument();
document.addField("id", UUID.randomUUID().toString());
document.addField("driverid", "1");
document.addField("latlong", "-6.081689,145.391881");
document.addField("time", "7:01:17");
document.addField("timestamp", Long.valueOf("1518908477190"));
document.addField("latlong2", "-6.081689,145.391881");
document.addField("location_0_coordinate", Double.valueOf(-6.081689));
document.addField("location_1_coordinate", Double.valueOf(145.391881));
UpdateResponse response = solr.add(document);
solr.commit();
response.getQTime();

I've attached my schema.xml file herewith. Can someone let me know what I'm 
doing wrong?



David Howe
Java Domain Architect
Postal Systems
Australia Post

Level 16, 111 Bourke Street Melbourne VIC 3000

T  0391067904

M 0424036591

E  david.h...@auspost.com.au
[Australia Post website]
[StarTrack website]
[Follow us on Twitter] [Like us on Facebook] 
  [Connect with us on LinkedIn] 



Australia Post is committed to providing our customers with excellent service. 
If we can assist you in any way please telephone 13 13 18 or visit our website.

The information contained in this email communication may be proprietary, 
confidential or legally professionally privileged. It is intended exclusively 
for the individual or entity to which it is addressed. You should only read, 
disclose, re-transmit, copy, distribute, act in reliance on or commercialise 
the information if you are authorised to do so. Australia Post does not 
represent, warrant or guarantee that the integrity of this email communication 
has been maintained nor that the communication is free of errors, virus or 
interference.

If you are not the addressee or intended recipient please notify us by replying 
direct to the sender and then destroy any electronic or paper copy of this 
message. Any views expressed in this email communication are taken to be those 
of the individual sender, except where the sender specifically attributes those 
views to Australia Post and is authorised to do so.

Please consider the environment before printing this email.