Book Image

Apache Solr Enterprise Search Server - Third Edition

By : David Smiley, Eric Pugh, Kranti Parisa, Matt Mitchell
Book Image

Apache Solr Enterprise Search Server - Third Edition

By: David Smiley, Eric Pugh, Kranti Parisa, Matt Mitchell

Overview of this book

<p>Solr Apache is a widely popular open source enterprise search server that delivers powerful search and faceted navigation features—features that are elusive with databases. Solr supports complex search criteria, faceting, result highlighting, query-completion, query spell-checking, relevancy tuning, geospatial searches, and much more.</p> <p>This book is a comprehensive resource for just about everything Solr has to offer, and it will take you from first exposure to development and deployment in no time. Even if you wish to use Solr 5, you should find the information to be just as applicable due to Solr's high regard for backward compatibility. The book includes some useful information specific to Solr 5.</p>
Table of Contents (19 chapters)
Apache Solr Enterprise Search Server Third Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Sorting


The sorting specification is specified with the sort query parameter. The default is score desc. Here, score is not a field but a special reference to a relevancy number, described in detail in the next chapter. Whereas, desc means descending order; use asc for ascending order. Before Solr 4.2, it needed to be lowercase. In the following example, suppose we search for artists that are not individuals (a previous example in the chapter), and then we might want to ensure that those that are surely bands get top placement ahead of those that are unknown. Secondly, we want the typical descending score search. This would simply be:

sort=a_type desc,score desc

Note

Pay attention to the field types and text analysis you're using in your schema for fields that you sort on. Basically, fields need to be single valued, indexed, and not tokenized. Some, but not all, support sortMissingFirst and sortMissingLast options. See the section on sorting in Chapter 2, Schema Design, for further information...