`
brxonline
  • 浏览: 64318 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

solr1.4使用(2)-schema.xml说明

    博客分类:
  • SOLR
阅读更多
<?xml version="1.0" encoding="UTF-8" ?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<!--  
 This is the Solr schema file. This file should be named "schema.xml" and
 should be in the conf directory under the solr home
 (i.e. ./solr/conf/schema.xml by default) 
 or located where the classloader for the Solr webapp can find it.

 This example schema is the recommended starting point for users.
 It should be kept correct and concise, usable out-of-the-box.

 For more information, on how to customize this file, please see
 http://wiki.apache.org/solr/SchemaXml
-->

<schema name="musicbrainz" version="1.1">
  <!-- attribute "name" is the name of this schema and is only used for display purposes.
       Applications should change this to reflect the nature of the search collection.
       version="1.1" is Solr's version number for the schema syntax and semantics.  It should
       not normally be changed by applications.
       1.0: multiValued attribute did not exist, all fields are multiValued by nature
       1.1: multiValued attribute introduced, false by default -->

  <types>
    <!-- field type definitions. The "name" attribute is
       just a label to be used by field definitions.  The "class"
       attribute and any other attributes determine the real
       behavior of the fieldType.
         Class names starting with "solr" refer to java classes in the
       org.apache.solr.analysis package.
    -->

    <!-- The StrField type is not analyzed, but indexed/stored verbatim.  
       - StrField and TextField support an optional compressThreshold which
       limits compression (if enabled in the derived fields) to values which
       exceed a certain size (in characters).
	   name: 字段类型名
	   class: java类名
	   indexed:缺省true。 说明这个数据应被搜索和排序,如果数据没有indexed,则stored应是true。
	   stored: 缺省true。说明这个字段被包含在搜索结果中是合适的。如果数据没有stored,则indexed应是true。
	   sortMissingLast:指没有该指定字段数据的document排在有该指定字段数据的document的后面
	   sortMissingFirst:指没有该指定字段数据的document排在有该指定字段数据的document的前面
	   omitNorms:字段的长度不影响得分和在索引时不做boost时,设置它为true。一般文本字段不设置为true。
	   termVectors:如果字段被用来做more like this 和highlight的特性时应设置为true。
	   compressed:字段是压缩的。这可能导致索引和搜索变慢,但会减少存储空间,只有StrField和TextField是可以压缩,这通常适合字段的长度超过200个字符。
	   multiValued:字段多于一个值的时候,可设置为true。
	   positionIncrementGap:和multiValued一起使用,设置多个值之间的虚拟空白的数量
    -->
	
    <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>

    <!-- boolean type: "true" or "false" -->
    <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>

    <!-- The optional sortMissingLast and sortMissingFirst attributes are
         currently supported on types that are sorted internally as strings.
       - If sortMissingLast="true", then a sort on this field will cause documents
         without the field to come after documents with the field,
         regardless of the requested sort order (asc or desc).
       - If sortMissingFirst="true", then a sort on this field will cause documents
         without the field to come before documents with the field,
         regardless of the requested sort order.
       - If sortMissingLast="false" and sortMissingFirst="false" (the default),
         then default lucene sorting will be used which places docs without the
         field first in an ascending sort and last in a descending sort.
    -->    


    <!-- numeric field types that store and index the text
         value verbatim (and hence don't support range queries, since the
         lexicographic ordering isn't equal to the numeric ordering) -->
    <fieldType name="integer" class="solr.IntField" omitNorms="true"/>
    <fieldType name="long" class="solr.LongField" omitNorms="true"/>
    <fieldType name="float" class="solr.FloatField" omitNorms="true"/>
    <fieldType name="double" class="solr.DoubleField" omitNorms="true"/>


    <!-- Numeric field types that manipulate the value into
         a string value that isn't human-readable in its internal form,
         but with a lexicographic ordering the same as the numeric ordering,
         so that range queries work correctly. -->
    <fieldType name="sint" class="solr.SortableIntField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="slong" class="solr.SortableLongField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
    <fieldType name="sdouble" class="solr.SortableDoubleField" sortMissingLast="true" omitNorms="true"/>


    <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
         is a more restricted form of the canonical representation of dateTime
         http://www.w3.org/TR/xmlschema-2/#dateTime    
         The trailing "Z" designates UTC time and is mandatory.
         Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
         All other components are mandatory.

         Expressions can also be used to denote calculations that should be
         performed relative to "NOW" to determine the value, ie...

               NOW/HOUR
                  ... Round to the start of the current hour
               NOW-1DAY
                  ... Exactly 1 day prior to now
               NOW/DAY+6MONTHS+3DAYS
                  ... 6 months and 3 days in the future from the start of
                      the current day
                      
         Consult the DateField javadocs for more information.
      -->
    <fieldType name="date" class="solr.DateField" sortMissingLast="true" omitNorms="true"/>


    <!-- The "RandomSortField" is not used to store or search any
         data.  You can declare fields of this type it in your schema
         to generate psuedo-random orderings of your docs for sorting 
         purposes.  The ordering is generated based on the field name 
         and the version of the index, As long as the index version
         remains unchanged, and the same field name is reused,
         the ordering of the docs will be consistent.  
         If you want differend psuedo-random orderings of documents,
         for the same version of the index, use a dynamicField and
         change the name
     -->
    <fieldType name="random" class="solr.RandomSortField" indexed="true" />

    <!-- solr.TextField allows the specification of custom text analyzers
         specified as a tokenizer and a list of token filters. Different
         analyzers may be specified for indexing and querying.

         The optional positionIncrementGap puts space between multiple fields of
         this type on the same document, with the purpose of preventing false phrase
         matching across fields.

         For more info on customizing your analyzer chain, please see
         http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters
     -->

    <!-- One can also specify an existing Analyzer class that has a
         default constructor via the class attribute on the analyzer element
    <fieldType name="text_greek" class="solr.TextField">
      <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
    </fieldType>
    -->

    <!-- A text field that only splits on whitespace for exact matching of words -->
    <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
      </analyzer>
    </fieldType>

    <!-- A text field that uses WordDelimiterFilter to enable splitting and matching of
        words on case-change, alpha numeric boundaries, and non-alphanumeric chars,
        so that a query of "wifi" or "wi fi" could match a document containing "Wi-Fi".
        Synonyms and stopwords are customized by external files, and stemming is enabled.
        Duplicate tokens at the same position (which may result from Stemmed Synonyms or
        WordDelim parts) are removed.
        -->
    <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <!-- Case insensitive stop word removal.
             enablePositionIncrements=true ensures that a 'gap' is left to
             allow for accurate phrase queries.
        -->
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>


    <!-- Less flexible matching, but less false matches.  Probably not ideal for product names,
         but may be good for SKUs.  Can insert dashes in the wrong place and still match. -->
    <fieldType name="textTight" class="solr.TextField" positionIncrementGap="100" >
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>

    <!-- MusicBrainz names for things -->
    <fieldType name="title" class="solr.TextField" positionIncrementGap="100" >
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <!-- <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/> -->
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <!-- <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> -->
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>

    <!--
     Setup simple analysis for spell checking
     
    <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" stored="false" >
      <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>
-->

	<fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" stored="false" multiValued="true">
	  <analyzer type="index">
	    <tokenizer class="solr.StandardTokenizerFactory"/>
	    <filter class="solr.LowerCaseFilterFactory"/>
	    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
	    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
	    <filter class="solr.StandardFilterFactory"/>
	    <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
	  </analyzer>
	  <analyzer type="query">
	    <tokenizer class="solr.StandardTokenizerFactory"/>
	    <filter class="solr.LowerCaseFilterFactory"/>
	    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
	    <filter class="solr.StandardFilterFactory"/>
	    <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
	  </analyzer>
	</fieldType>
	<!-- names & titles only -->
	<fieldType name="textSpellPhrase" class="solr.TextField" positionIncrementGap="100" stored="false" multiValued="true">
	  <analyzer>
	    <tokenizer class="solr.KeywordTokenizerFactory"/>
	    <filter class="solr.LowerCaseFilterFactory"/>
	  </analyzer>
	</fieldType>
	
    <!-- This is an example of using the KeywordTokenizer along
         With various TokenFilterFactories to produce a sortable field
         that does not include some properties of the source text
      -->
    <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
      <analyzer>
        <!-- KeywordTokenizer does no actual tokenizing, so the entire
             input string is preserved as a single token
          -->
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <!-- The LowerCase TokenFilter does what you expect, which can be
             when you want your sorting to be case insensitive
          -->
        <filter class="solr.LowerCaseFilterFactory" />
        <!-- The TrimFilter removes any leading or trailing whitespace -->
        <filter class="solr.TrimFilterFactory" />
        <!-- The PatternReplaceFilter gives you the flexibility to use
             Java Regular expression to replace any sequence of characters
             matching a pattern with an arbitrary replacement string, 
             which may include back refrences to portions of the orriginal
             string matched by the pattern.
             
             See the Java Regular Expression documentation for more
             infomation on pattern and replacement string syntax.
             
             http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html
          -->
        <filter class="solr.PatternReplaceFilterFactory"
                pattern="([^a-z])" replacement="" replace="all"
        />
      </analyzer>
    </fieldType>

    <fieldType name="rType" class="solr.TextField" sortMissingLast="true" omitNorms="true">
       <analyzer>
         <tokenizer class="solr.KeywordTokenizerFactory"/>
         <filter class="solr.PatternReplaceFilterFactory"
                 pattern="^(0|1\d\d)$" replacement="" replace="first" />
         <filter class="solr.LengthFilterFactory" min="1" max="100" />
         <filter class="solr.SynonymFilterFactory" synonyms="mb_attributes.txt" ignoreCase="false" expand="false"/>
       </analyzer>
     </fieldType>
     
     <fieldType name="rOfficial" class="solr.TextField" sortMissingLast="true" omitNorms="true">
        <analyzer>
          <tokenizer class="solr.KeywordTokenizerFactory"/>
          <filter class="solr.PatternReplaceFilterFactory"
                  pattern="^(0|\d\d?)$" replacement="" replace="first" />
          <filter class="solr.LengthFilterFactory" min="1" max="100" />
          <filter class="solr.SynonymFilterFactory" synonyms="mb_attributes.txt" ignoreCase="false" expand="false"/>
        </analyzer>
      </fieldType>
      
      <fieldType name="bucketFirstLetter" class="solr.TextField" sortMissingLast="true" omitNorms="true">
         <analyzer type="index">
           <tokenizer class="solr.PatternTokenizerFactory" pattern="^([a-zA-Z]).*" group="1" />
           <filter class="solr.SynonymFilterFactory" synonyms="mb_letterBuckets.txt" ignoreCase="true" expand="false"/>
         </analyzer>
         <analyzer type="query">
             <tokenizer class="solr.KeywordTokenizerFactory"/>
         </analyzer>
       </fieldType>
      
    <!-- since fields of this type are by default not stored or indexed, any data added to 
         them will be ignored outright 
     --> 
    <fieldtype name="ignored" stored="false" indexed="false" class="solr.StrField" /> 

 </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.
	   name:字段的名字。
	   type:字段的类型。
	   default:一般用来记录索引的时间。
	   required:设置为true时,当字段没有值,则solr会索引文档失败。
   -->

   <field name="id" type="string" required="true" /><!-- Artist:11650 -->

   <field name="type" type="string" required="true" /><!-- Artist | Release | Label -->

<!-- artist -->

   <field name="a_name" type="title" /><!-- The Smashing Pumpkins -->
   <field name="a_name_sort" type="string" stored="false" /><!-- Smashing Pumpkins, The -->
   <field name="a_alias" type="title" stored="false" multiValued="true" />   
   <field name="a_type" type="string" /><!-- group | person -->
   <field name="a_begin_date" type="date" />
   <field name="a_end_date" type="date" />
   <field name="a_member_name" type="title" multiValued="true" /><!-- Billy Corgan -->
   <field name="a_member_id" type="title" multiValued="true" /><!-- 102693 -->
   <field name="a_release_date_latest" type="date" />
	
   <!--note: for spell correction; populated via copyFields -->
   <field name="a_spell" type="textSpell" />
	<field name="a_spellPhrase" type="textSpellPhrase" />
   
<!-- release -->

   <field name="r_name" type="title" /><!-- Siamese Dream -->
   <field name="r_name_sort" type="alphaOnlySort" stored="false"/><!-- Siamese Dream -->
   <field name="r_name_facetLetter" type="bucketFirstLetter" stored="false" />
   
   <field name="r_a_name" type="title" /><!-- The Smashing Pumpkins -->
   <field name="r_a_id" type="string" /><!-- 11650 -->
   <!-- Attributes 1-11: Album | Single | EP |... etc. -->
   <!-- Attributes 100+: Official | Bootleg | Promotional -->
   <field name="r_attributes" type="integer" multiValued="true" indexed="false" /><!-- ex: 0, 1, 100 -->
   <field name="r_type" type="rType" multiValued="true" stored="false"/><!-- Album | Single | EP |... etc. -->
   <field name="r_official" type="rOfficial" multiValued="true" stored="false"/><!-- Official | Bootleg | Promotional -->
         
   <field name="r_lang" type="string" indexed="false" /> <!-- eng / latn -->
   <field name="r_tracks" type="sint" indexed="false" />
   <field name="r_event_country" type="string" multiValued="true" /><!-- us -->
   <field name="r_event_date" type="date" multiValued="true" />
	<field name="r_event_date_earliest" type="date" multiValued="false" />
   
<!-- label -->

   <field name="l_name" type="title" /><!-- Virgin Records America -->
   <field name="l_name_sort" type="string" stored="false" />
   <field name="l_type" type="string" /><!-- Distributor, Orig. Prod., Production -->
   <field name="l_begin_date" type="date" />
   <field name="l_end_date" type="date" />
   
<!-- track -->

   <field name="t_name" type="title" /><!-- Cherub Rock -->
   <field name="t_duration" type="sint"/><!-- 298 (seconds) -->
   <field name="t_a_id" type="string" /><!-- 11650 -->
   <field name="t_a_name" type="title" /><!-- The Smashing Pumpkins -->
   <field name="t_num" type="integer" indexed="false" /><!-- 1 -->
   <field name="t_r_id" type="string" /><!-- 22429 -->
   <field name="t_r_name" type="title" /><!-- Siamese Dream -->
   <field name="t_r_attributes"  multiValued="true" type="integer" /><!-- album | single | compilation -->
   <field name="t_r_tracks" type="sint" /><!-- 13 -->
   <field name="t_trm_lookups" type="sint" /><!-- 250 -->
   
   <!-- TODO -->
   <field name="word" type="ignored" />
   <field name="includes" type="ignored" />
   
 </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>a_name</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.  -->
     <copyField source="a_name" dest="a_spell" />
     <copyField source="a_alias" dest="a_spell" />
     <copyField source="a_name" dest="a_spellPhrase" />
     <copyField source="a_alias" dest="a_spellPhrase" />

     <copyField source="r_name" dest="r_name_sort" />
     <copyField source="r_name" dest="r_name_facetLetter" />
     <copyField source="r_attributes" dest="r_type" />
     <copyField source="r_attributes" dest="r_official" />

     
     
    <!-- Similarity is the scoring routine for each document vs. a query.
         A custom similarity may be specified here, but the default is fine
         for most applications.  -->
    <!-- <similarity class="org.apache.lucene.search.DefaultSimilarity"/> -->
    <!-- ... OR ...
         Specify a SimilarityFactory class name implementation
         allowing parameters to be used.
    -->
    <!--
    <similarity class="com.example.solr.CustomSimilarityFactory">
      <str name="paramkey">param value</str>
    </similarity>
    -->
 
</schema>
分享到:
评论

相关推荐

    Window下Solr1.4安装部署

    ### Window下Solr1.4安装部署的知识点详解 #### 一、Solr简介 Apache Solr 是一个高性能、基于Lucene的全文检索服务。它提供了丰富的功能集,包括高度可扩展性、易于部署和强大的搜索功能。Solr 1.4版本是在2009年...

    apache-solr-1.4.0.zip_apache-solr _apache-solr-1.4.0_apache-solr

    2. **配置灵活**:Solr的配置文件如solrconfig.xml和schema.xml允许用户自定义索引和查询行为。solrconfig.xml用于配置索引和查询处理链,而schema.xml则定义了字段类型、字段和字段的处理规则。 3. **分布式搜索**...

    solar1.4环境配置

    solr-1.4.1 环境配置: 1、 下载所需软件,安装配置...在X:\solr\solr\conf当中有schema.xml文件,可以配置索引数据格式。 5、运行solr 启动Tomcat,访问http://localhost:8983 6、添加索引 7、添加中文分词

    apache solr server 1.4 pdf格式英文帮助文档

    4. **配置修改**:编辑 `solrconfig.xml` 和 `schema.xml` 文件来定制 Solr 的行为。 5. **索引数据**:将数据导入到 Solr 的索引中,以便后续查询。 #### 使用场景 Solr 可广泛应用于各类企业级应用中,如电子商务...

    IKAnalyzer分词器 下载IKAnalyzer2012FF_u1.jar

    对solr1.4提供接口实现 使用IK分词器,应为该集群使用到的solr版本为4.10.3-cdh5.7.5,所以使用的 IK 包为IKAnalyzer2012FF_u1.jar,如果是3x的solr,使用IKAnalyzer2012_u6.jar 具体操作如下: 引用 1.在/opt/...

    solr教材-PDF版

    **4.2 Solrj的使用说明** - **4.2.1 AddingData to Solr**:通过SolrJ向Solr添加数据的方法。 - **4.2.2 Directly adding POJOsto Solr**:直接将Java对象转换为Solr文档并存储。 - **4.2.3 ReadingData from Solr*...

    IKAnalyzer2012FF_u1.jar

    对solr1.4提供接口实现 使用IK分词器,应为该集群使用到的solr版本为4.10.3-cdh5.7.5,所以使用的 IK 包为IKAnalyzer2012FF_u1.jar,如果是3x的solr,使用IKAnalyzer2012_u6.jar solr-4.10.3下载地址:...

    开源企业搜索引擎SOLR的 应用教程

    **4.2 Solrj的使用说明** - **4.2.1 AddingDatatoSolr** 通过SolrJ API添加数据到Solr。 - **4.2.2 DirectlyaddingPOJOstoSolr** 将POJO对象直接转换为Solr文档。 - **4.2.3 ReadingDatafromSolr** 从Solr读取...

    Apache Solr初级教程.docx

    在实际使用中,可以通过修改`solr/conf`目录下的配置文件来定制Solr的行为,如`schema.xml`用于定义字段和索引规则,`solrconfig.xml`配置索引和查询行为。同时,可以通过Web管理界面(`...

    solr学习入门教程

    典型的Solr主目录包括bin(用于放置集群复制脚本)、conf(配置文件)、data(索引文件)、lib(依赖库)、schema.xml(模式定义文件)等关键部分。理解并熟悉这些目录的用途对于正确配置和运行Solr至关重要。 ####...

    solr 企业搜索引擎教程

    - **XML配置**:使用XML文件进行灵活配置。 - **插件体系**:支持插件扩展功能,如自定义分析器、过滤器等。 - **兼容性**:Solr创建的索引与Lucene搜索引擎库完全兼容,这意味着Solr可以读取并利用其他Lucene...

    Solr3.5开发应用指导

    **4.2 Solrj的使用说明** - **4.2.1 AddingDatatoSolr**:通过SolrInputDocument对象添加文档。 - **4.2.2 DirectlyaddingPOJOstoSolr**:可以直接将Java对象转换为索引文档。 - **4.2.3 ReadingDatafromSolr**:...

    Solr 教程 pdf

    - 多核配置方法,以及配置文件说明,比如schema.xml和solrconfig.xml。 在应用方面: - 概述了Solr应用模式和使用过程。 - 提供了一个简单的例子,包括Solr Schema设计、构建索引和搜索测试。 - 探讨了搜索引擎的...

    solr+tomcat完成搜索功能

    在`solr_home/collection1/conf/schema.xml`文件中,需要配置fileType,以便指定中文分析器。 **2.3 业务字段配置** 针对具体的业务需求,需要定义一系列的业务字段。例如: - 商品ID - 商品标题 - 卖点 - 商品...

    1.4、solrj的使用_代码开始1

    // 第一个参数是域的名称,必须在schema.xml中定义 // 第二个参数是域的值 document.addField("id", "solr001"); document.addField("product_name", "小米手机"); document.addField("product_price", "2000")...

    sunspot_cell:[DEAD]对Sunspot的单元支持

    黑子细胞 此插件为Sunspot(针对... 对Solr schema.xml调整: 称=“已忽略”存储 false”索引=“ multiValued =“ true”类=“&gt;和&lt;dynamicField name =“ * _ attachment” stored =“ true” type =“文本” mult

    开源企业搜索引擎SOLR的应用教程

    - **Solrj使用说明**: 包括添加数据、读取数据、创建查询等功能。 - **包结构**: Solrj的包结构清晰,易于理解和使用。 #### 十一、Solr的实际应用测试报告 - **压力测试**: 验证Solr在高并发下的性能表现。 - **...

    Solrj 中文教程

    - **4.2 Solrj的使用说明**:通过示例代码展示如何使用Solrj。 - **4.2.1 AddingData to Solr**:如何使用Solrj添加数据到索引。 - **4.2.2 Directly adding POJOs to Solr**:如何直接将Java对象转换为Solr文档。 -...

Global site tag (gtag.js) - Google Analytics