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

You're reading from  Apache Solr for Indexing Data

Product type Book
Published in Dec 2015
Publisher
ISBN-13 9781783553235
Pages 160 pages
Edition 1st Edition
Languages
Concepts

Table of Contents (18) Chapters

Apache Solr for Indexing Data
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Getting Started Understanding Analyzers, Tokenizers, and Filters Indexing Data Indexing Data – The Basic Technique and Using Index Handlers Indexing Data with the Help of Structured Datasources – Using DIH Indexing Data Using Apache Tika Apache Nutch Commits, Real-Time Index Optimizations, and Atomic Updates Advanced Topics – Multilanguage, Deduplication, and Others Distributed Indexing Case Study of Using Solr in E-Commerce Index

Facet navigation


We've seen previously how Solr provides a facet, by using which we can put indexed data into groups depending on the fields. Let's see how we can improve user experience while selecting the type of music by grouping music into genres.

We can use facet=true to enable faceting of fields, and then use facet.field=genre to return the number of songs that are in each category. The search query will return only the facet data and will look like this:

http://localhost:8983/solr/musicStore/select?q=*%3A*&start=0&rows=0&wt=json&indent=true&facet=true&facet.field=genre

As we're interested in the facet data only, we've specified rows=0. This URL will return us the following data:

{
   "responseHeader":{   },
   "response":{   },
   "facet_counts":{
      "facet_queries":{ },
      "facet_fields":{
         "genre":[
            "Pop", 3,
            "Dance/Electronic", 2
         ]
      },
      "facet_dates":{},
      "facet_ranges":{},
      "facet_intervals...
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}