zoukankan      html  css  js  c++  java
  • Solr中schema.xml的Field介绍

    Field详解

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

    name: 指定域的名称(自定义)

    type: 指定域的类型

    indexed: 是否索引

      是: (将分好的次进行索引,索引的目的,就是为了搜索)

      否: 不索引,也就是不对该field域搜索。

    stored: 是否存储

      是:将field中的内容存储到文档中。存储目的就是为了搜索显示取值用。

      否:不将field域中的内容存储到文档中,并且搜索页面无法取到field域的值。

    required: 是否必须

    multiValued: 是否多值,比如查询数据需要关联多个字段数据,一个Field存储多个值信息,必须将multiValued设置为true。

    uniqueKey

     <uniqueKey>id</uniqueKey> 

    id就是Field标签中已经定义好的域名,而且改域设置required为true。

     copyField 复制域

    1、两个普通的域 title和author

     <field name="title"    type="text_general"       indexed="true" stored="true"/>
     <field name="author"    type="text_general"       indexed="true" stored="true"/>
    

    2、使用复制域,将两个域进行索引检索

     <copyField source="title"   dest="mytext"/>
     <copyField source="author"   dest="mytext"/>
    

    3、该域名field name=“mytext”就是复制域

     <field name="mytext"    type="text_general"       indexed="true" stored="true" multiValued="true" />
    

      

    solr的fieldType属性

    solr的fieldType属性 javaBean属性类型
    string String
    boolean Boolean
    pint   Integer
    pdouble Double
    plong Long
    pfloat Float
    pdate Date

      






    作者:Work Hard Work Smart
    出处:http://www.cnblogs.com/linlf03/
    欢迎任何形式的转载,未经作者同意,请保留此段声明!

  • 相关阅读:
    寿司点餐系统Sprint1总结
    寿司点餐系统一周总结
    对点餐APP现阶段开发的问题
    寿司点餐系统11.16
    Sprint
    R扩展包
    实验8 SQLite数据库操作
    实验7 BindService模拟通信
    实验6 在应用程序中播放音频和视频
    实验5 数独游戏界面设计
  • 原文地址:https://www.cnblogs.com/linlf03/p/14726323.html
Copyright © 2011-2022 走看看