首页 > 学院 > 开发设计 > 正文

在Solr6.3中创建core

2019-11-06 08:57:19
字体:
来源:转载
供稿:网友

一、新建core

新建的solrhome文件的位置为:D:/solr/solrhome

1. 创建new_core文件夹

2.%20复制D:/solr/solrhome/configsets/basic_configs/conf到new_core文件夹中

3.在http://localhost:8080/solr/index.html管理界面中添加new_core

点击%20add%20Core%20按钮进行添加

添加成功如下:

4.%20可以在Core%20Selector%20中对Core进行操作

Analysis中可以对分词器分词效果进行查看

Query中测试查询

二、添加数据项

1. 在D:/solr/solrhome/new_core/conf中创建new_core-data-config.xml文件

2. 在new_core-data-config.xml文件中进行数据设置

<dataConfig>	<document>        <entity name="solrMessage" pk="id">            <field name="id" />              <field name="title"/>  			<field name="description"/>  			<field name="keyWords"/>  			<field name="url"/> 			<field name="pagepath"/>  			        </entity>    </document></dataConfig>其中id设置为主键

3. 在managed-schema插入如下代码:

<field name="title" type="string" indexed="true" stored="true" required="true" multiValued="true" />    <field name="description" type="string" indexed="true" stored="true" required="true" multiValued="true" />    <field name="keywords" type="string" indexed="true" stored="true" required="true" multiValued="true" />    <field name="url" type="string" indexed="true" stored="true" required="true" multiValued="true" />    <field name="pagepath" type="string" indexed="true" stored="true" required="true" multiValued="true" />对core的操作完成。然后在solrJ中对数据项进行操作

学习笔记所用,如有错误欢迎指出。

参考:http://www.cnblogs.com/fengzhanfei/p/6178261.html


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表