SOLR and MySQL (ii)

Source: Internet
Author: User
Tags solr

Today's study still makes people very tired, encountered the bug how to change not to come over, finally see which several configuration files are dizzy, simply all overturned again.

Looked over a lot of online tutorials, learning process has been overturned, finally finished, come up to summarize.

Home dashboard is mainly to display various system information. Logging inside is the log message. The core Admin page is used for kernel management.

First try adding a core ... Well, it failed.

Let's first copy the example from the SOLR archive that we downloaded earlier, in the solr-7.1.0 folder in the example folder. The path to my folder is: D:\SOLR\SOLR-7.1.0\EXAMPLE\EXAMPLE-DIH\SOLR.

The new solr_home in the D-Drive was useful yesterday. Create a new folder named New_core (you can pick it up). Cuff the things in the example just now.

Restart Tomcat to access SOLR. Found something in the core admin just changed.

These five things one by one correspond to the contents of the copy in the Solr folder. Then, why do this, the meaning of this step is what, I do not know, is to follow the Tutorial = ...

Next is the complete self-create a core, and import the contents of the MySQL database, this is the focus of my study today!

1. Make sure there's something in the database.

2. Continue to create a new storage Core folder in Solr_home, named Mycore.

3. Copy the Conf folder in the solr-7.1.0 file in the Solr-7.1.0\server\solr\configsets\sample_techproducts_configs path.

Next, you need to create or modify several of these configuration files.

The Db-data-config.xml file that corresponds to the entity in the MySQL database, which I wrote:

Before you determine your own tomcat, there are mysql-connector-java-6.0.6.jar packages under the Webapps\solr\web-inf\lib path.

4. Then add this section to the Solrconfig.xml file and import the XML you just wrote:

<requesthandler name= "/dataimport" class= "Org.apache.solr.handler.dataimport.DataImportHandler" >
<lst name= "Defaults" >

<str name= "config" >db-data-config.xml</str>
</lst>
</requestHandler>

5.managed-schema file, you need to add the fields in the database table, note the case, I capitalize the string first letter, the bug for half a day.

<field name= "Actors" type= "string" indexed= "false" stored= "true"/>
<field name= "Director" Type= "string" indexed= "false" stored= "true"/>

As you can see, you need to copy the Managed-schema file and rename it to "Schema.xml".

Managed-schema is an administrative file of the Schema.xml file, the data in the Schema.xml file is written to the Managed-schema and can be checked if a run exception occurs (viewed from the log).

So change to Schema.xml, the next add core, Shema box content to also need to change to schema.xml.

Source: http://www.cnblogs.com/DASOU/p/5903001.html

6. Launch Tomcat to access the connection.

After the new success, the list will have a value. Select the new core in the core Selecor in the directory, and then select DataImport.

Select the corresponding entity =>execute to perform the =>refresh status refresh.

Even if this state of being is successful. Next we can check in query.

Finally see the database in the thing finally import come in ... Cry =a=!

SOLR and MySQL (ii)

Related Article

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.