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/
    欢迎任何形式的转载,未经作者同意,请保留此段声明!

  • 相关阅读:
    Linux基本命令
    IDEA实用插件
    Windows常用快捷键
    IDEA常用快捷键
    OOP三大特性之多态
    IDEA里配置SSM框架,配置没问题却报404错误
    Tomcat的80端口被占用问题_解决方案
    基于SpringBoot开发
    java数据结构--线性表
    代码优化设计(一)
  • 原文地址:https://www.cnblogs.com/linlf03/p/14726323.html
Copyright © 2011-2022 走看看