2014年10月27日 星期一

Solr_05_02_Fields

Defining Fields

e.g
<field name="price" type="float" default="0.0" indexed="true" stored="true"/>
Field Properties - 其它的屬性可參照General Properties(通用屬性) / Field Element Default Properties (字段元素預屬性)
Property描述Description
name由字母、數字、下底線形成的名稱,但不可以為數字開頭。 所有的field必需有一個名稱The name of the field. Field names should consist of alphanumeric or underscore characters only and
not start with a digit. This is not currently strictly enforced, but other field names will not have first
class support from all components and back compatibility is not guaranteed. Names with both leading
and trailing underscores (e.g. _version_) are reserved. Every field must have a name.
type每個field必需有一個type,對應的type必需定義在fieldType 元素之中The name of the fieldType for this field. This will be found in the "name" attribute on the fieldTyp
e definition. Every field must have a type.
default當檢索指定的值域未有結果,則會將預設的值做為參考文件被自動加入到結果之中,反之則無結果。A default value that will be added automatically to any document that does not have a value in this
field when it is indexed. If this property is not specified, there is no default.
如果有一對多關系時,required參數需要為false

沒有留言:

張貼留言