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
沒有留言:
張貼留言