Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apache Solr Search Patterns

You're reading from   Apache Solr Search Patterns Leverage the power of Apache Solr to power up your business by navigating your users to their data quickly and efficiently

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher
ISBN-13 9781783981847
Length 316 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jayant Kumar Jayant Kumar
Author Profile Icon Jayant Kumar
Jayant Kumar
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Solr Indexing Internals FREE CHAPTER 2. Customizing the Solr Scoring Algorithm 3. Solr Internals and Custom Queries 4. Solr for Big Data 5. Solr in E-commerce 6. Solr for Spatial Search 7. Using Solr in an Advertising System 8. AJAX Solr 9. SolrCloud 10. Text Tagging with Lucene FST Index

Searching and filtering on a spatial index


Spatial fields in a Solr index can be searched and filtered using the {!geofilt} and {!bbox} query filters. These filters were introduced and are available in Solr 4.2 onward. We saw a working example of geofilt earlier in this chapter. Let us go through some other queries that can be executed on a spatial index in Solr.

The bbox query

The working of a bbox filter is similar to that of geofilt, except that the former uses the bounding box of a calculated circle. The query remains the same, except that we use the {!bbox} filter instead of the {!geofilt} filter. To convert the earlier query to bbox from geofilt, we run the following query:

http://localhost:8983/solr/collection1/select/?q=*:*&fq={!bbox pt=28.643059,77.368885 sfield=store d=10}

The output in our case would remain the same as that in the figure – Stores within 10 km from our location point – shown earlier in this chapter, but the search now includes the grayed-out area, as shown in the...

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 $19.99/month. Cancel anytime
Banner background image