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

PropertyReturnsDescription
branchBranchThe branch that hosts the search index this result was found in, looked up and cached on first access.
categoryStringThe category the matching item was indexed under, if any.
indexIdStringThe identifier of the search index this result was found in, used to look up the index's branch.
itemTypeStringThe 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.
matchesList<String>The text snippets from the item's content that matched the search query.
modifiedDateDateThe date the matching item was last modified, as recorded in the search index.
pathStringThe repository-relative path of the item this result refers to, as indexed at search time.
tagsList<String>The tags associated with the matching item, as recorded in the search index.
targetGroupsList<String>The groups the matching item is targeted at, as recorded in the search index, used to filter results by audience.
titleStringThe 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.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.