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

Search filtering and sorting


In the previous section, we saw how we can use the facet feature to group data together and seethe number of results in each genre. We can use the fq parameter to further limit the search. Let's now see how we can use the fq parameter to return only those songs whose genre is Pop:

http://localhost:8983/solr/musicStore/select?q=*%3A*&wt=json&indent=true&fq=genre:Pop&fl=id,songName,genre

This URL will result in the following output:

{
   "responseHeader":{
      "status":0,
      "QTime":2
   },
   "response":{
      "numFound":3,
      "start":0,
      "docs":[
         {
            "id":"1001",
            "songName":"Don't Stop the Party",
            "genre":"Pop"
         },
         {
            "id":"1002",
            "songName":"All I Want For Christmas Is You",
            "genre":"Pop"
         },
         {
            "id":"1003",
            "songName":"A Thousand Years",
            "genre":"Pop"
         }
      ]
   }
}

As we can...

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}