SOLR Database import data import Handler

Source: Internet
Author: User
Tags solr

Data Import Handler

Can be from the database, webpage address such as Sword Jiven file.

Can be added in full amount, also support incremental add (only add modified content)

With Dih, you need 3 steps of important configuration.

First, add the jar packages that are used to the solrconfig.

<lib dir= ". /.. /.. /contrib/dataimporthandler/lib "regex=". *\.jar "/>
<lib dir= ". /.. /.. /dist/"regex=" Solr-dataimporthandler-.*\.jar "/>

Second, configure the DataImport request processor in the Solrconfig

<requesthandler name= "/dataimport"
class= "Org.apache.solr.handler.dataimport.DataImportHandler" >
<lst name= "Defaults" >
<str name= "config" >data-config.xml</str>
</lst>
</requestHandler>

Finally, a configuration file for Dih is provided with a data import. The above is defined as Data-config.xml, and the directory is a relative directory of conf/.

This file contains references to all data sources, as well as steps to convert the data to a document. Support for multiple data sources, complex conversion logic (including scripting languages that support operations to import data)

See SOLR wiki for specific content

Http://wiki.apache.org/solr/DataImportHandler

************************************************************************************************

* Example of starting Dih

BIN/SOLR-E Dih

Related terms:

Datasource: Data source. For example, the database to provide a database connection, user name and password

Entity: Entities are used to generate documents, the entity of the database is the table

Processor: The entity processor is used to extract data, turn it into a document, and add an index. Supports user-defined processor.

Transformer: Converter. Enables customization by changing fields, creating new fields, generating multiple documents from one line, and more.

Example: Example of DB in Example-dih.

The configuration file is a database conversion configuration for the <dataConfig> tag, which can be used as a parameter to the DIH processor.

Dih request sent to SOLR via HTTP request

Parameters for full-amount submissions

Property Writer

An optional configuration for the Dih configuration file that defines the date format and location information. See the documentation.

*entity processors entity processor, see document for specific parameters

SOLR Database import data import Handler

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.