Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Apache Solr for Indexing Data

You're reading from   Apache Solr for Indexing Data Enhance your Solr indexing experience with advanced techniques and the built-in functionalities available in Apache Solr

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781783553235
Length 160 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Authors (2):
Arrow left icon
 Handiekar Handiekar
Author Profile Icon Handiekar
Handiekar
 Johri Johri
Author Profile Icon Johri
Johri
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Apache Solr for Indexing Data
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started FREE CHAPTER 2. Understanding Analyzers, Tokenizers, and Filters 3. Indexing Data 4. Indexing Data – The Basic Technique and Using Index Handlers 5. Indexing Data with the Help of Structured Datasources – Using DIH 6. Indexing Data Using Apache Tika 7. Apache Nutch 8. Commits, Real-Time Index Optimizations, and Atomic Updates 9. Advanced Topics – Multilanguage, Deduplication, and Others 10. Distributed Indexing 11. Case Study of Using Solr in E-Commerce Index

Indexing updates using CSV


At last, we'll now see how we can index CSV data in Solr using Content-Type: text/csv. A sample CSV file has been provided at %SOLR_EXAMPLES/Chapter-4/sampleMusicCatalog.csv, and we can use it to add documents to our musicCatalgoue example.

The following is an example of indexing data using the curl command:

curl 'http://localhost:8983/solr/musicCatalog/update' --data-binary @sampleMusicCatalog.csv -H 'Content-type:application/csv'

In the preceding command, we're telling CSVUpdateHandler to use the first line of the CSV as the header row, which will contain the field name. If the CSV does not have a header row, we can use the header=false parameter, which will tell UpdateHandler that there is no header row present. We can specify the field names in the CSV using another parameter named fieldnames, which accepts a comma-separated list of field names for the CSV file. There are a lot of optional configurations that can be set on the update handler. More information...

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 £13.99/month. Cancel anytime
Visually different images