首页 > 代码库 > solr的schema.xml配置介绍

solr的schema.xml配置介绍

schema.xml配置介绍如下:

 常见的元素有以下几种:

<field name="weight" type="float" indexed="true" stored="true"/>

<dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
<dynamicField name="*_is" type="int"    indexed="true"  stored="true"  multiValued="true"/>

<copyField source="cat" dest="text"/>

 

参考文档:http://wiki.apache.org/solr/

上面xml格式官方介绍如下:

The schema.xml file contains all of the details about which fields your documents can contain, and how those fields should be dealt with when adding documents to the index, or when querying those fields.

这个schema.xml 文件包含所有的细节,这些细节包括你的多个文档可以包含哪些字段;添加多个文档到索引,或者查询这些字段的时候这些字段是如何处理的。

Analysis for Multiterm queries can be separately specified, see: Multiterm Query Analysis, which handles automatically lowercasing wildcard queries under most circumstances. <!> Solr3.6 <!> Solr4.0

多条查询的分析可以单独指定,在大多数环境下可以自动处理小写字母通配符查询

A sample Solr schema.xml with detailed comments can be found in the Source Repository.

 

This example schema is the recommended starting point for users.It should be kept correct and concise, usable out-of-the-box.
这个例子schema是推荐给用户学习的入门例子。它应该保持正确性、简洁性、可用性、开箱即用。
For more information, on how to customize this file, please see http://wiki.apache.org/solr/SchemaXml
想了解更多的信息,如何定制这个文件,请参考链接:


PERFORMANCE NOTE: this schema includes many optional features and should not be used for benchmarking.  To improve performance one could

执行需要注意的地方:这个schema包含许多可选的特性,不应该被用来作为基准例子。为了提高性能,我们可以这样做:
 - set stored="false" for all fields possible (esp large fields) when you only need to search on the field but don‘t need to return the original value.
 - set indexed="false" if you don‘t need to search on the field, but only return the field as a result of searching on other indexed fields.
 - remove all unneeded copyField statements
 - for best index size and searching performance, set "index" to false for all general text fields, use copyField to copy them to the catchall "text" field, and   use that for searching.
 - For maximum indexing performance, use the ConcurrentUpdateSolrServer java client.
 - Remember to run the JVM in server mode, and use a higher logging level that avoids logging every request

solr的schema.xml配置介绍