O'Reilly logo

Apache Solr Search Patterns by Jayant Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Indexing for spatial search

Now that we know the features supported by Solr for spatial search, let us see how indexing should be done for spatial search. We will need to index the coordinates for point, circle, rectangle, and other spatial representations in Solr as documents before we execute a search for them. Every geographical point is represented as latitude and longitude with the format lat,lon.

We saw points being indexed in the last section in our location.csv file. They are indexed in the lat,lon format:

<field name="store">28.570485,77.324713</field>

The points can be indexed in the lat-lon format by omitting the comma:

<field name="store">28.570485 77.324713</field>

We saw that Solr also supports different geometrical shapes such as rectangle, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required