启动start
bin/solr start -help 查看start帮助
bin/solr start 启动单机版
window下操作方式:
进入:E:\solr\solr-8.2.0\bin
C:\Users\Administrator>cd E:\solr\solr-8.2.0\bin C:\Users\Administrator>e: E:\solr\solr-8.2.0\bin>solr.cmd start Java HotSpot(TM) 64-Bit Server VM warning: JVM cannot use large page memory because it does not have enough privilege to lock pages in memory. Waiting up to 30 to see Solr running on port 8983 Started Solr server on port 8983. Happy searching! E:\solr\solr-8.2.0\bin>solr.in.cmd start
输入solr.in.cmd start 启动Solr:
http://localhost:8983/ (访问地址)
停止solr
bin/solr stop -all
window下的操作方式:
solr.cmd stop -all
复制:E:\solr\solr-8.2.0\server\solr\configsets\sample_techproducts_configs
重命名:l2qq,放在 E:\solr\solr-8.2.0\server\solr\ 里面
solrconfig.xml
添加如下:
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
<requestHandler name="/dataimport" class="solr.DataImportHandler"> <lst name="defaults"> <str name="config">db-data-config.xml</str> </lst> </requestHandler>
db-data-config.xml
添加如下:
<dataConfig> <dataSource name="source1" type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://mysql.l2qq.com:6633/l2qq" user="fmpoffice" password="Office123123!!@@$$##"/> <document> <!-- transformer 格式转化:HTMLStripTransformer 索引中忽略HTML标签 --> <entity name="share" transformer="HTMLStripTransformer" pk="ID" dataSource="source1" deltaImportQuery="SELECT `share`.id, `share`.title, `share`.content, `share`.createAt, `share`.last_index_time, `share`.is_delete FROM `share` where last_index_time > '${dataimporter.last_index_time}' " query="SELECT `share`.id, `share`.title, `share`.content, `share`.createAt, `share`.last_index_time, `share`.is_delete FROM `share`" deltaQuery="SELECT `share`.id, `share`.title, `share`.content, `share`.createAt, `share`.last_index_time, `share`.is_delete FROM `share` where last_index_time > '${dataimporter.last_index_time}'" > <!-- query:查询所有未删除记录数据,主要用在full-import全量导入时候 --> <field column="id" name="id"/> <field column="title" name="title"/> <field column="content" name="content" stripHTML="true" /> <field column="createAt" name="createAt"/> <field column="last_index_time" name="last_index_time"/> <field column="is_delete" name="is_delete"/> </entity> </document> </dataConfig>
最新评论 0