完整的solr的增加索引的xml的格式

一个完整的solr的增加索引的xml的格式:

 

<add allowDups = "true">


  <doc boost="2.5">
    <field name="Id">05991</field>
    <field name="title" boost="2.0">Bridgewater</field>

    <field name="content" boost="4.0">solr is very good search engine!</field>
  </doc>

 

  <doc>....</doc>

  <doc>....</doc>

 

  <commit/>
  <optimize/>


</add>

--------------------------------------------

一:

Optional attributes for "add"
  • allowDups = "true" | "false" — default is "false"

  • commitWithin = "(milliseconds)" if the "commitWithin" attribute is present, the document will be added within that time. <!>Solr1.4

  • (deprecated) overwritePending = "true" | "false" — default is negation of allowDups

  • (deprecated) overwriteCommitted = "true"|"false" — default is negation of allowDups

The defaults for overwritePending and overwriteCommitted are linked to allowDups such that those defaults make more sense:

  • If allowDups is false (overwrite any duplicates), it implies that overwritePending and overwriteCommitted are true by default.

  • If allowDups is true (allow addition of duplicates), it implies that overwritePending and overwriteCommitted are false by default.

二:

Optional attributes for "commit" and "optimize"
  • maxSegments = N — default is '1' — optimizes down to at most this number of segments <!>Solr1.3

  • waitFlush = "true" | "false" — default is true — block until index changes are flushed to disk

  • waitSearcher = "true" | "false" — default is true — block until a new searcher is opened and registered as the main query searcher, making the changes visible.

 

用这个命令创建索引文件:

java -Durl=http://localhost:8080/solr/update -Ddata=files -jar post.jar  *.xml    

 

根据solr wiki 相关文章整理,详文请看:http://wiki.apache.org/solr/UpdateXmlMessages

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值