schema.xml (rails sunspot_solr 在tomact项目里的配置文件)

<?xml version="1.0" encoding="UTF-8"?>

<schema name="sunspot" version="1.0">
<types>


<fieldType name="string" class="solr.StrField" omitNorms="true"/>

<fieldType name="tdouble" class="solr.TrieDoubleField" omitNorms="true"/>

<fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>

<fieldType name="text" class="solr.TextField" omitNorms="false">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>

<fieldType name="boolean" class="solr.BoolField" omitNorms="true"/>

<fieldType name="date" class="solr.DateField" omitNorms="true"/>

<fieldType name="sdouble" class="solr.SortableDoubleField" omitNorms="true"/>

<fieldType name="sfloat" class="solr.SortableFloatField" omitNorms="true"/>

<fieldType name="sint" class="solr.SortableIntField" omitNorms="true"/>

<fieldType name="slong" class="solr.SortableLongField" omitNorms="true"/>

<fieldType name="tint" class="solr.TrieIntField" omitNorms="true"/>

<fieldType name="tfloat" class="solr.TrieFloatField" omitNorms="true"/>

<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true"/>

    <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
    <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
</types>
<fields>
    <!-- Valid attributes for fields:
     name: mandatory - the name for the field
     type: mandatory - the name of a previously defined type from the
     <types> section
     indexed: true if this field should be indexed (searchable or sortable)
     stored: true if this field should be retrievable
     compressed: [false] if this field should be stored using gzip compression
     (this will only apply if the field type is compressable; among
     the standard field types, only TextField and StrField are)
     multiValued: true if this field may contain multiple values per document
     omitNorms: (expert) set to true to omit the norms associated with
     this field (this disables length normalization and index-time
     boosting for the field, and saves some memory).  Only full-text
     fields or fields that need an index-time boost need norms.
     termVectors: [false] set to true to store the term vector for a
     given field.
     When using MoreLikeThis, fields used for similarity should be
     stored for best performance.
     termPositions: Store position information with the term vector.
     This will increase storage costs.
     termOffsets: Store offset information with the term vector. This
     will increase storage costs.
     default: a value that should be used if no value is specified
     when adding a document.
     -->
    <!-- *** This field is used by Sunspot! *** -->
    <field name="id" stored="true" type="string" multiValued="false" indexed="true"/>
    <!-- *** This field is used by Sunspot! *** -->
    <field name="type" stored="false" type="string" multiValued="true" indexed="true"/>
    <!-- *** This field is used by Sunspot! *** -->
    <field name="class_name" stored="false" type="string" multiValued="false" indexed="true"/>
    <!-- *** This field is used by Sunspot! *** -->
    <field name="text" stored="false" type="string" multiValued="true" indexed="true"/>
    <!-- *** This field is used by Sunspot! *** -->
    <field name="lat" stored="true" type="tdouble" multiValued="false" indexed="true"/>
    <!-- *** This field is used by Sunspot! *** -->
    <field name="lng" stored="true" type="tdouble" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="random_*" stored="false" type="rand" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="_local*" stored="false" type="tdouble" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_text" stored="false" type="text" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_texts" stored="true" type="text" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_b" stored="false" type="boolean" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_bm" stored="false" type="boolean" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_bs" stored="true" type="boolean" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_bms" stored="true" type="boolean" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_d" stored="false" type="date" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_dm" stored="false" type="date" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_ds" stored="true" type="date" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_dms" stored="true" type="date" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_e" stored="false" type="sdouble" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_em" stored="false" type="sdouble" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_es" stored="true" type="sdouble" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_ems" stored="true" type="sdouble" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_f" stored="false" type="sfloat" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_fm" stored="false" type="sfloat" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_fs" stored="true" type="sfloat" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_fms" stored="true" type="sfloat" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_i" stored="false" type="sint" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_im" stored="false" type="sint" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_is" stored="true" type="sint" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_ims" stored="true" type="sint" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_l" stored="false" type="slong" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_lm" stored="false" type="slong" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_ls" stored="true" type="slong" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_lms" stored="true" type="slong" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_s" stored="false" type="string" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_sm" stored="false" type="string" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_ss" stored="true" type="string" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_sms" stored="true" type="string" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_it" stored="false" type="tint" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_itm" stored="false" type="tint" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_its" stored="true" type="tint" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_itms" stored="true" type="tint" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_ft" stored="false" type="tfloat" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_ftm" stored="false" type="tfloat" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_fts" stored="true" type="tfloat" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_ftms" stored="true" type="tfloat" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_dt" stored="false" type="tdate" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_dtm" stored="false" type="tdate" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_dts" stored="true" type="tdate" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_dtms" stored="true" type="tdate" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_textv" stored="false" termVectors="true" type="text" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_textsv" stored="true" termVectors="true" type="text" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_et" stored="false" termVectors="true" type="tdouble" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_etm" stored="false" termVectors="true" type="tdouble" multiValued="true" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_ets" stored="true" termVectors="true" type="tdouble" multiValued="false" indexed="true"/>
    <!-- *** This dynamicField is used by Sunspot! *** -->
    <dynamicField name="*_etms" stored="true" termVectors="true" type="tdouble" multiValued="true" indexed="true"/>
    
    <!-- Type used to index the lat and lon components for the "location" FieldType -->
    <dynamicField name="*_coordinate"  type="tdouble" indexed="true"  stored="false" multiValued="false"/>
    <dynamicField name="*_p" type="location" indexed="true" stored="true" multiValued="false"/>
    
    <dynamicField name="*_ll" stored="false" type="location" multiValued="false" indexed="true"/>
    <dynamicField name="*_llm" stored="false" type="location" multiValued="true" indexed="true"/>
    <dynamicField name="*_lls" stored="true" type="location" multiValued="false" indexed="true"/>
    <dynamicField name="*_llms" stored="true" type="location" multiValued="true" indexed="true"/>
    
    <!-- required by Solr 4 -->
    <field name="_version_" type="string" indexed="true" stored="true" multiValued="false" />
</fields>

<!-- Field to use to determine and enforce document uniqueness.
 Unless this field is marked with required="false", it will be a required field
 -->
<uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>text</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="AND"/>
<!-- copyField commands copy one field to another at the time a document
 is added to the index.  It's used either to index the same field differently,
 or to add multiple fields to the same field for easier/faster searching.  -->

</schema>

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,547评论 6 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,399评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,428评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,599评论 1 274
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,612评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,577评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,941评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,603评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,852评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,605评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,693评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,375评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,955评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,936评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,172评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,970评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,414评论 2 342

推荐阅读更多精彩内容

  • =========================================================...
    lavor阅读 3,482评论 0 5
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,585评论 18 139
  • 诸侯靠血缘和阶级构建他们的金字塔网络和链接 墨家依靠技能和知识努力在那个时代构建一个平行分布式网络 或许是生产力受...
    轩然有容容阅读 225评论 0 0
  • 爱是什么,我也不知道,我只是记得一些痛—题记 有人说爱是甜的,我不知道怎么算是爱,也不知道什么样的感情才算爱情,可...
    第八族阅读 232评论 0 0
  • 1.自定义标注和气泡的时候高德地图不能对layer动手,会导致标注的点击事件不走代理。很坑。但是百度地图是可以的!...
    flyinskybiu阅读 283评论 0 0