0
votes

I am currently trying to get a simple geospatial example working.It is a fresh database with data loaded following the steps shown in this link. I have checked various threads and I do not understand what I am currently missing. An example entry from http://localhost:8983/solr/test/select?q=* can be seen below.

2   
    id  "6H500F0"
    name    
        0   "Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300"
    manu    
        0   "Maxtor Corp."
    manu_id_s   "maxtor"
    cat 
        0   "electronics"
        1   "hard drive"
    features    
        0   "SATA 3.0Gb/s, NCQ"
        1   "8.5ms seek"
        2   "16MB cache"
    price   
        0   350
    popularity  
        0   6
    inStock 
        0   true
    store   
        0   "45.17614,-93.87341"
    manufacturedate_dt  "2006-02-13T15:26:37Z"
    _version_   1630485042534809600

Necessary managed_schema portions

<fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true"/>
<field name="store" type="location"/>

From here i attempted to use the query

http://localhost:8983/solr/test/select?&q=*:*&fq={!geofilt%20sfield=store}&pt=45.17614,-93.87341&d=9999999

Which results in an empty query. Any help will be greatly appreciated.

1
Did you change the field before indexing the document? - MatsLindh
@MatsLindh, I actually found out the problem which was what you are suspecting the need to re-index as i changed my scheme. Therefore, I would like to ask if you know a way to determine the datatype for each field before loading of the data? - WhiteSolstice
The schemaless mode attempts to guess the datatype from the initial type submitted for the field, but you do not want to use that for production usage usually. - MatsLindh

1 Answers

0
votes

After changing the field type a document usually has to be reindexed for the internal data structure to change (and to support special kinds of queries).

The exception is if only the query part of an analysis chain is changed.