solr5.0学习总结

1、将solr-5.0.0_安装包.tgz解压。(解压命令:tar -zxvf solr-5.0.0.tgz 

solr搭建

http://blog.csdn.net/freedomboy319/article/details/44095875

solr 分词

http://blog.csdn.net/freedomboy319/article/details/44097215


相关配置见代码:

数据库索引配置

http://www.cnblogs.com/luxiaoxun/p/4442770.html

增量建立索引

https://yq.aliyun.com/articles/50467

http://my.oschina.net/scottCoder/blog/640653?p={{currentPage%201}}

http://www.mamicode.com/info-detail-1150757.html

多列,实现对象包含对象:

http://blog.csdn.net/zl3450341/article/details/12849341

<?xml version="1.0" encoding="UTF-8"?>
<dataConfig>    
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://192.168.10.10:3307/user" user="root" password="12345" batchSize="-1" />
  <document name="testDoc">
        <entity name="subjectList" pk="id"
                query="select * from subject where status=1"
         <!---增量索引及修改索引->
                deltaQuery="select id from subject where updated_at > '${dataimporter.last_index_time}'"
	        deltaImportQuery="select * from subject  where id= '${dih.delta.id}'">     
        <!---删除索引-->
             <span class="attribute" style="background-repeat: no-repeat; margin: 0px; padding: 0px; color: rgb(0, 128, 128); font-family: monospace; white-space: pre;">deletedPkQuery</span><span style="color: rgb(0, 0, 128); font-family: monospace; white-space: pre;">=</span><span class="value" style="background-repeat: no-repeat; margin: 0px; padding: 0px; color: rgb(221, 17, 68); font-family: monospace; white-space: pre;">"select * from subject where status=0"</span><span style="color: rgb(0, 0, 128); font-family: monospace; white-space: pre;"> </span>
            <field column="id" name="id"/>
            <field column="uniq_id" name="uniqId"/>
          <field column="name" name="name"/>
            <field column="name_us" name="nameUs"/>
            <field column="sort" name="sort"/>
           <field column="display_in_us" name="displayInUs"/>
           <field column="status" name="status"/>
            <field column="updated_at" name="updatedAt"/>
            <field column="created_at" name="createdAt"/>

     </entity>
  </document>
</dataConfig>

在查询的sql中,其中的一个字段存储一个对象可以这么编辑:

<entity name="imgUrlAndType"
               query="select CONCAT(type,':',(select CONCAT('http://',ip) from storage_server),'/',ci.img_url) imgUrl from course_image ci where ci.region_type =1 and course_id ='${courseList.uniqId}'">
              <field column="imgUrl" name="imgUrl"/>
 </entity>


<field name="imgUrl" type="string" indexed="true" stored="true" multiValued="true" />



配置数据库时时更新内容(如果有更改更新索引)

solr-5.0.0/server/solr/conf

目录下的

dataimport.properties





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值