In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
# solr version: 7.4.0
First, create a new Core
Go to server/solr/, under the installation directory to create a folder, such as: new_core
Copy the solrconfig.xml, protwords.txt, synonyms.txt, stopwords.txt files and lang folder under server/solr/configsets/_default/conf/ to the new_core folder you just created
Copy the schema.xml file under server/solr/configsets/_default/conf/ to the new_core folder you just created and rename it to schema.xml
Go to the solr page and select Core Admin, set the name and the dir,Add Core you just created
Then you can see the newly built core in core selector.
2. Import MySQL data
Open the newly added solrconfig.xml file vi server/solr/new_core/solrconfig.xml, look for the requestHandler tag, add a new db-data-config.xml file under the configuration db-data-config.xmlnew_core of imported data at the same level of the tag (sample is available under the installation directory example/example-DIH/solr/db/conf/), and add the following configuration: download the mysql-connector-java driver https://dev.mysql.com/downloads/connector/j/
Extract mysql-connector-java- (xxx) .jar to server/solr-webapp/webapp/WEB-INF/lib in the installation directory and select Dataimport on the page. You should have it.
Add fields to the Schema, such as title (among those fields that can be found by a sql statement with a query attribute)
Perform the import on Dataimport and you can see that four new records have been added
Then view the import results on query
Third, import MySQL data incrementally
It is impossible to import all the imported data every time. Just import the new data incrementally. Check the db-data-config.xml configuration to make sure there are two items: deltaImportQuery and deltaQuery.
Last_index_time will save the conf/dataimport.properties file in the Instance directory of this core
Now I'll insert a few more pieces of data into the data table.
This time, let's select delta-import to execute on the page.
Then take a look at the results, and they were also successfully imported.
5. This is careful people will find that dataimport.properties records the UTC time, while the data sheet uses Chinese time, how to make them consistent?
Here is a solution to convert the time zone using SQL statements:
Modify deltaQuerySELECT product_id AS id FROM table_name WHERE add_time >'${dataimporter.last_index_time}'
Change to
SELECT product_id AS id FROM table_name WHERE add_time > CONVERT_TZ ('${dataimporter.last_index_time}','+ 00 dataimporter.last_index_time 00','+ 08 dataimporter.last_index_time 00')
IV. Chinese word segmentation
Copy the participle jar to the specified directory server/solr-webapp/webapp/WEB-INF/lib/cp contrib/analysis-extras/lucene-libs/lucene-analyzers-smartcn-7.4.0.jar server/solr-webapp/webapp/WEB-INF/lib/ to edit the schema file vi server/solr/new_core/conf/managed-schema
Add:
Change title to text_cn type
Restart solr,title has been changed to text_cn, but there is no word segmentation effect.
Select clean in dataimport to full-import again, re-import the data, and then go back to the field to check Term Info. This time the word segmentation is successful.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.