Represents a single hit in a search result page, with the matching item's location, title, matched text snippets and metadata. Instances are constructed from a search index entry and are used to render result listings and, on demand, to resolve back to the underlying Milton resource.
Properties
| Property | Returns | Description |
|---|---|---|
| branch | Branch | The branch that hosts the search index this result was found in, looked up and cached on first access. |
| category | String | The category the matching item was indexed under, if any. |
| indexId | String | The identifier of the search index this result was found in, used to look up the index's branch. |
| itemType | String | The type of item this result represents, as recorded in the search index (for example a content page or a file), used to distinguish result kinds in a mixed results listing. |
| matches | List<String> | The text snippets from the item's content that matched the search query. |
| modifiedDate | Date | The date the matching item was last modified, as recorded in the search index. |
| path | String | The repository-relative path of the item this result refers to, as indexed at search time. |
| tags | List<String> | The tags associated with the matching item, as recorded in the search index. |
| targetGroups | List<String> | The groups the matching item is targeted at, as recorded in the search index, used to filter results by audience. |
| title | String | The display title of the matching item, as indexed at search time. |
Methods
getPath() · getTitle() · getMatches() · getModifiedDate() · getIndexId() · getItemType() · getCategory() · getTags() · getTargetGroups() · resource() · getBranch()
getPath()
Returns: String
The repository-relative path of the item this result refers to, as indexed at search time.
getTitle()
Returns: String
The display title of the matching item, as indexed at search time.
getMatches()
Returns: List<String>
The text snippets from the item's content that matched the search query.
getModifiedDate()
Returns: Date
The date the matching item was last modified, as recorded in the search index.
getIndexId()
Returns: String
The identifier of the search index this result was found in, used to look up the index's branch.
getItemType()
Returns: String
The type of item this result represents, as recorded in the search index (for example a content page or a file), used to distinguish result kinds in a mixed results listing.
getCategory()
Returns: String
The category the matching item was indexed under, if any.
getTags()
Returns: List<String>
The tags associated with the matching item, as recorded in the search index.
getTargetGroups()
Returns: List<String>
The groups the matching item is targeted at, as recorded in the search index, used to filter results by audience.
resource()
Returns: Resource
Resolves and caches the Milton resource this result refers to, by looking it up in the current root folder using this result's path. Subsequent calls return the cached resource without repeating the lookup.
getBranch()
Returns: Branch
The branch that hosts the search index this result was found in, looked up and cached on first access.