Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Apache Solr Search Patterns

You're reading from  Apache Solr Search Patterns

Product type Book
Published in Apr 2015
Publisher
ISBN-13 9781783981847
Pages 316 pages
Edition 1st Edition
Languages
Author (1):
Jayant Kumar Jayant Kumar
Profile icon Jayant Kumar

Table of Contents (17) Chapters

Apache Solr Search Patterns
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Solr Indexing Internals Customizing the Solr Scoring Algorithm Solr Internals and Custom Queries Solr for Big Data Solr in E-commerce Solr for Spatial Search Using Solr in an Advertising System AJAX Solr SolrCloud Text Tagging with Lucene FST Index

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, circle, and polygon. Let us learn how to index these.

In order to index a rectangle, we need the two points that form the starting and the ending points of the rectangle. Consider a two-dimensional coordinate system with...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}