SOLR Import CSV file

Source: Internet
Author: User
Tags documentation solr solr documentation
< c13>1 Overview

Most applications store data in relational databases, XML files. Searching for such data is a very common application. The so-called Dataimporthandler provides a configurable way to import data to SOLR, which can be imported all at once or incrementally.

Ability to read data in a relational database.

The ability to generate multi-column, multi-table data from a database in the SOLR document in a configurable way

Ability to update SOLR through SOLR documentation

Provides the ability to import all data through a configuration file

Ability to configure time for full import and incremental import

Let's read the XML file and make the index configurable.

The ability to integrate other data sources (for example: ftp,scp,etc) or other forms of documentation (JSON,CSV) into the project as plug-ins.


2.2 Importing a CSV file 2.2.1 Configuring import Fields

Modify the Managed-schema file to add:

<field name= "id" type= "string" stored= "true" indexed= "true"/>  
<field name= "title" Type= "string" stored= " True "indexed=" true "/>  
<field name=" Content "type=" string "stored=" true "indexed=" true "/>  

  2.2.2   Edit import file

 


2.2.3   Import There are several

Import methods, the following are listed in two ways to import,

1, import by command:

dos into solr\bin directory execution

java- Dtype=text/csv-durl=http://localhost:8983/solr/solr_test/update-jar Post.jar xxx.csv 


2, Browser HTTP import:

Accesses core cores in a browser, where Solr_file is the core name:

Http://localhost:8983/solr/solr_file/update/csv? commit=true&stream.file=e:/application.csv&stream.contenttype=text/plain;charset=gb2312

 


After execution is complete, you can query the imported data;



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.