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

Atomic updates and optimistic concurrency


Atomic updates allow you to update an already indexed document by giving a new field value, adding a value to the existing values on a multivalued field, or by incrementing a numeric field. Instead of giving an entire document, you supply a document that only has the fields that are to be modified in some way, and with a special modifier (described next). If Solr sees these modifiers on any field in an incoming document, then it knows this is an atomic-update to an existing document versus a new or replacement document. This is both a convenience feature, and with optimistic concurrency (described soon), allows Solr to be a credible NoSQL option.

We'll show you how this is used by way of a succinct example, and we'll use JSON this time. Note that, most fields don't just have a value but are structured to include one of several mutation modifiers. In the XML syntax, these are specified with attributes.

{"id":"mydoc",
 "price":{"set":99},
 "popularity...