Hello,
we are using solr 4.10.1. There are two cores for different use cases with
around 20 million documents (location descriptions) per core. Each document has
a geometry field which stores a point and a bbox field which stores a bounding
box. Both fields are defined with:
<fieldType name="t_geometry" class="solr.SpatialRecursivePrefixTreeFieldType"
spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
geo="true" distErrPct="0.025" maxDistErr="0.00009"
units="degrees" />
I'm currently trying to add a location search (find all documents around a
point). My intention is to add this as filter query, so that the user is able
to do an additional keyword search. These are the query parameters so far:
q=*:*&fq=typ:strasse&fq={!geofilt sfield=geometry
pt=51.370570625523,12.369290471603 d=1.0}
To sort the documents by their distance to the requested point, I added
following sort parameter:
sort={!geofilt sort=distance sfield: geometry
pt=51.370570625523,12.369290471603 d=1.0} asc
Unfortunately I'm experiencing here some major performance/memory problems. The
first distance query on a core takes over 10 seconds. In my first setup the
same request to the second core completely blocked the server and caused an
OutOfMemoryError. I had to increase the memory to 16 GB and now it seems to
work for the geometry field. Anyhow the first request after a server restart
takes some time and when I try it with the bbox field after a requested on the
geometry field in both cores, the server blocks again.
Can anyone explain why the distance needs so much memory? Can this be optimized?
Kind regards,
Dirk