Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Lucene 4 Cookbook

You're reading from  Lucene 4 Cookbook

Product type Book
Published in Jun 2015
Publisher
ISBN-13 9781782162285
Pages 220 pages
Edition 1st Edition
Languages
Authors (2):
Edwood Ng Edwood Ng
Profile icon Edwood Ng
Vineeth Mohan Vineeth Mohan
Profile icon Vineeth Mohan
View More author details

Table of Contents (16) Chapters

Lucene 4 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Introducing Lucene Analyzing Your Text Indexing Your Data Searching Your Indexes Near Real-time Searching Querying and Filtering Data Flexible Scoring Introducing Elasticsearch Extending Lucene with Modules Index

Obtaining an IndexWriter


We have seen how an IndexWriter is obtained just by simply initialized with an Analyzer and IndexWriterConfig. The default initialization behavior usually works well for the majority of the time. However, there may be situations where you need finer control during the initialization sequence. For example, when the default behavior creates a new index if an existing index doesn't exist already. This may not be ideal in a production environment where an index should always exist. Generating a new index will automatically hide the issue that an index is missing. Perhaps there was a glitch in the backup routine where it accidentally removed the index, or there was a data corruption issue that somehow wiped out the index directory. In any case, it would be beneficial if we are aware of the indexing status and alerted when issues are detected.

Lucene does provide options to control how an index is opened. We will talk about each option in detail in this section and show...

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}