|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
Each document that you add to your search domain has a collection of fields that contain the data that can be searched or returned. The value of a field can be either text or a number. Every document must have a unique document ID, a version number, and at least one field.
In your domain configuration, you define all of the document fields you want to include in your index. Any fields that occur in a document that are not part of your domain configuration are ignored and will not be searchable or returnable. Documents can contain a subset of the fields configured for the domain—every document does not have to contain all fields.
By default, if no search field is specified in a search request, Amazon CloudSearch searches all text fields configured for the domain. You can change this behavior by specifying a default search field for the domain using the
UpdateDefaultSearchField configuration action.
Amazon CloudSearch supports three types of index fields:
text—a text field contains arbitrary alphanumeric data. A text field is always searchable. The value of a text field can either be returned in search results or the field can be used as a facet. By default, text fields are neither result-enabled or facet-enabled.
literal—a literal field contains an identifier or other data that you want to be able to match exactly. The value of a literal field can be returned in search results or the field can be used as a facet, but not both. By default, literal fields are not search-enabled, result-enabled, or facet-enabled.
uint—a uint field contains an unsigned integer value. Uint fields are always searchable, the value of a uint field can always be returned in results, and faceting is always enabled. Uint fields can also be used in rank expressions.
If your document data contains a text or literal field whose value you want to be able to return in results and also use as a facet, you can use the document field as a source for two different index fields and make one returnable, and enable faceting for the other.
When configuring index fields, you can specify:
Whether literal fields can be searched
Whether facets can be calculated for text or literal fields to enable filtering
Whether the contents of a text or literal field can be returned in the search results
A default value for the field
Up to 20 data sources for the field
Making text and literal fields result-enabled increases the size of your index, which can increase the cost of running your domain. When possible, it's best to retrieve large amounts of data from an external source, rather than embedding it in your index. Since it can take some time to apply document updates across the domain, critical data such as pricing information should be retrieved from an external source using the returned document IDs instead of returned from the index.
Field names must begin with a letter and be at least 3 and no more than 64 characters long. The allowed characters are: a-z (lower-case letters), 0-9, and _ (underscore). The names "body", "docid", and "text_relevance" are reserved names and cannot be specified as field names.
Adding Sources for an Amazon CloudSearch Index Field describes how document fields are used to populate your index fields.
You can configure fields using the
cs-configure-from-sdf or cs-configure-fields command, through the Amazon CloudSearch console, or using the
DefineIndexField configuration action.