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

Query parsers and local-params


A query parser parses a string into an internal Lucene query object, potentially considering request parameters and so-called local-params. Only a few parsers actually do real string parsing; some parsers—like those for geospatial—don't even use the query string. The default query parser is named lucene, and it has a special leading syntax to switch the parser to another and/or to specify parameters. Here's an example using the dismax parser along with two local-params and a query string of billy corgan:

{!dismax qf="a_name^2 a_alias" tie=0.1}billy corgan

Note

It's not common to see this syntax in the user query, q, since its parser is conveniently set via defType.

There are a few things to know about the local-params syntax:

  • The leading query parser name (for example, DisMax) is optional. Without it, the parser remains as lucene. Furthermore, this syntax is a shortcut to put the query parser name in the type local-param.

  • Usually, a query parser treats local-params...