Class Result

  • All Implemented Interfaces:
    ResultType

    public class Result
    extends Object
    implements ResultType
    A single search result.
    Since:
    11.0
    • Field Detail

      • rank

        private Integer rank
        Rank of the result (From 1 to n)
      • score

        private Integer score
        Score of the result (From 1000 to 0)
      • title

        private String title
        Title of the result
      • collection

        private String collection

        ID of the collection to which this result belongs.

        This is usually the same ID as the collection being searched, except for Meta collections where results can come from different sub-collections.

      • component

        private Integer component

        For meta collections it's the internal component number of the sub-collection this result is coming from.

        For non-meta collections it's always zero.

        See Also:
        collection
      • collapsed

        private Collapsed collapsed

        Result collapsing information for this result.

        Will be null if no results are collapsed with this one.

        Since:
        12.5
      • liveUrl

        private String liveUrl

        URL to access the search result.

        It's identical to the indexUrl initially, but might have been transformed by a hook script. The click tracking URL will be built based on this URL, so if you need to modify the URL that's recorded in the click log, this field should be changed.

        In the default form, its only use it to display a proper URL when the user mouse-over the result title link.

      • summary

        private String summary
        Query-biased summary
      • allSummaryText

        private String allSummaryText
        All texts available for generating summary text
        Since:
        15.18
      • cacheUrl

        private String cacheUrl
        URL to access the cached version of the result.
      • date

        private Date date
        Date of the search result
      • fileSize

        private Integer fileSize
        Size of the file corresponding to the search results, in bytes.
      • fileType

        private String fileType
        File type of the result, usually the file extension ("pdf", "xls", "html", ...)
      • docNum

        private Integer docNum
        Internal document number of the result in the index.
      • exploreLink

        private String exploreLink
        Link to the also of interest CGI.
      • kmFromOrigin

        private Float kmFromOrigin
        Distance in kilometres of this search result from the origin set when the query is run.
      • definedMetadataSeparators

        private final com.google.common.collect.ListMultimap<String,​String> definedMetadataSeparators

        Map containing the separators defined for each metadata class.

        Intended only for internal use, and not exposed in the XML/JSON data model.

        Please note that currently separators are defined globally, however this data-model aims to support the possibility of per-class separators in the future.

        Since:
        15.16
        See Also:
        Metadata classes
      • listMetadata

        private final com.google.common.collect.ListMultimap<String,​String> listMetadata

        Multi-Map containing the list of metadata values for each metadata fields for each result.

        The key is the metadata class name as defined in the metadata mappings.

        The values are each mapped metadata value, split based on any defined separators.

        Since:
        15.16
        See Also:
        Metadata classes
      • listMetadataSeparators

        private final com.google.common.collect.ListMultimap<String,​String> listMetadataSeparators

        Multi-Map containing the separators originally used by the metadata values within in newMetadata.

        Intended only for internal use, and not exposed in the XML/JSON data model.

        This map is only of interest if the specific separators are meaningful to an implementation which is hopefully uncommon. If values are added to the newMetadata map, new separators may be added here also. Some separator from the definedMetadataSeparators list will be used for any added metadata if this map lacks sufficient values.

        Since:
        15.16
        See Also:
        Metadata classes
      • tags

        private final List<String> tags

        Tags associated with a result.

        See the url_tagger program.

      • quickLinks

        private QuickLinks quickLinks
        Quick links associated with the result.
      • displayUrl

        private String displayUrl

        URL to display for the result.

        Initially identical to indexUrl and liveUrl, but might have been transformed by a hook script. This URL can be used to display a different URL from the actual one, while preserving the liveUrl for the user to access the result.

        In the default form, this URL is displayed in the <cite> block for the the result

      • clickTrackingUrl

        private String clickTrackingUrl
        URL for click tracking.
      • explain

        private Explain explain
        Explain data used in the Content Optimiser.
      • indexUrl

        private String indexUrl
        Original URL from the index, taken from indexUrl before any transformation.
      • gscopesSet

        private Set<String> gscopesSet
        Set of GScope Numbers that this result has.
      • customData

        private final Map<String,​Object> customData
        Custom data placeholder allowing any arbitrary data to be stored by hook scripts.
      • relatedDocuments

        private final Map<String,​Set<RelatedDocument>> relatedDocuments
        Documents related to this result which have been fetched by RelatedDocumentFetcher. The map key is chosen by the related document fetching configuration and the set of related documents are those that were fetched based on the metadata relationships traversed by the configuration.
        Since:
        15.16
      • documentVisibleToUser

        private boolean documentVisibleToUser
      • promoted

        private boolean promoted
        Set true if the URL was promoted using -promote_urls.
        Since:
        15.12
      • diversified

        private boolean diversified
        Set true if the URL was down weighted by result diversification. This might happen from same site suppression (SSS).
        Since:
        15.12
    • Method Detail

      • getRank

        public Integer getRank()
        Rank of the result (From 1 to n)
      • setRank

        public void setRank​(Integer rank)
        Rank of the result (From 1 to n)
      • getScore

        public Integer getScore()
        Score of the result (From 1000 to 0)
      • setScore

        public void setScore​(Integer score)
        Score of the result (From 1000 to 0)
      • getTitle

        public String getTitle()
        Title of the result
      • setTitle

        public void setTitle​(String title)
        Title of the result
      • getCollection

        public String getCollection()

        ID of the collection to which this result belongs.

        This is usually the same ID as the collection being searched, except for Meta collections where results can come from different sub-collections.

      • setCollection

        public void setCollection​(String collection)

        ID of the collection to which this result belongs.

        This is usually the same ID as the collection being searched, except for Meta collections where results can come from different sub-collections.

      • getComponent

        public Integer getComponent()

        For meta collections it's the internal component number of the sub-collection this result is coming from.

        For non-meta collections it's always zero.

        See Also:
        collection
      • setComponent

        public void setComponent​(Integer component)

        For meta collections it's the internal component number of the sub-collection this result is coming from.

        For non-meta collections it's always zero.

        See Also:
        collection
      • getCollapsed

        public Collapsed getCollapsed()

        Result collapsing information for this result.

        Will be null if no results are collapsed with this one.

        Since:
        12.5
      • setCollapsed

        public void setCollapsed​(Collapsed collapsed)

        Result collapsing information for this result.

        Will be null if no results are collapsed with this one.

        Since:
        12.5
      • getLiveUrl

        public String getLiveUrl()

        URL to access the search result.

        It's identical to the indexUrl initially, but might have been transformed by a hook script. The click tracking URL will be built based on this URL, so if you need to modify the URL that's recorded in the click log, this field should be changed.

        In the default form, its only use it to display a proper URL when the user mouse-over the result title link.

      • setLiveUrl

        public void setLiveUrl​(String liveUrl)

        URL to access the search result.

        It's identical to the indexUrl initially, but might have been transformed by a hook script. The click tracking URL will be built based on this URL, so if you need to modify the URL that's recorded in the click log, this field should be changed.

        In the default form, its only use it to display a proper URL when the user mouse-over the result title link.

      • getSummary

        public String getSummary()
        Query-biased summary
      • setSummary

        public void setSummary​(String summary)
        Query-biased summary
      • getAllSummaryText

        public String getAllSummaryText()
        All texts available for generating summary text
        Since:
        15.18
      • setAllSummaryText

        public void setAllSummaryText​(String allSummaryText)
        All texts available for generating summary text
        Since:
        15.18
      • getCacheUrl

        public String getCacheUrl()
        URL to access the cached version of the result.
      • setCacheUrl

        public void setCacheUrl​(String cacheUrl)
        URL to access the cached version of the result.
      • getDate

        public Date getDate()
        Date of the search result
      • setDate

        public void setDate​(Date date)
        Date of the search result
      • getFileSize

        public Integer getFileSize()
        Size of the file corresponding to the search results, in bytes.
      • setFileSize

        public void setFileSize​(Integer fileSize)
        Size of the file corresponding to the search results, in bytes.
      • getFileType

        public String getFileType()
        File type of the result, usually the file extension ("pdf", "xls", "html", ...)
      • setFileType

        public void setFileType​(String fileType)
        File type of the result, usually the file extension ("pdf", "xls", "html", ...)
      • getDocNum

        public Integer getDocNum()
        Internal document number of the result in the index.
      • setDocNum

        public void setDocNum​(Integer docNum)
        Internal document number of the result in the index.
      • getExploreLink

        public String getExploreLink()
        Link to the also of interest CGI.
      • setExploreLink

        public void setExploreLink​(String exploreLink)
        Link to the also of interest CGI.
      • getKmFromOrigin

        public Float getKmFromOrigin()
        Distance in kilometres of this search result from the origin set when the query is run.
      • setKmFromOrigin

        public void setKmFromOrigin​(Float kmFromOrigin)
        Distance in kilometres of this search result from the origin set when the query is run.
      • getDefinedMetadataSeparators

        public com.google.common.collect.ListMultimap<String,​String> getDefinedMetadataSeparators()

        Map containing the separators defined for each metadata class.

        Intended only for internal use, and not exposed in the XML/JSON data model.

        Please note that currently separators are defined globally, however this data-model aims to support the possibility of per-class separators in the future.

        Since:
        15.16
        See Also:
        Metadata classes
      • getListMetadata

        public com.google.common.collect.ListMultimap<String,​String> getListMetadata()

        Multi-Map containing the list of metadata values for each metadata fields for each result.

        The key is the metadata class name as defined in the metadata mappings.

        The values are each mapped metadata value, split based on any defined separators.

        Since:
        15.16
        See Also:
        Metadata classes
      • getListMetadataSeparators

        public com.google.common.collect.ListMultimap<String,​String> getListMetadataSeparators()

        Multi-Map containing the separators originally used by the metadata values within in newMetadata.

        Intended only for internal use, and not exposed in the XML/JSON data model.

        This map is only of interest if the specific separators are meaningful to an implementation which is hopefully uncommon. If values are added to the newMetadata map, new separators may be added here also. Some separator from the definedMetadataSeparators list will be used for any added metadata if this map lacks sufficient values.

        Since:
        15.16
        See Also:
        Metadata classes
      • getTags

        public List<String> getTags()

        Tags associated with a result.

        See the url_tagger program.

      • getQuickLinks

        public QuickLinks getQuickLinks()
        Quick links associated with the result.
      • setQuickLinks

        public void setQuickLinks​(QuickLinks quickLinks)
        Quick links associated with the result.
      • getDisplayUrl

        public String getDisplayUrl()

        URL to display for the result.

        Initially identical to indexUrl and liveUrl, but might have been transformed by a hook script. This URL can be used to display a different URL from the actual one, while preserving the liveUrl for the user to access the result.

        In the default form, this URL is displayed in the <cite> block for the the result

      • setDisplayUrl

        public void setDisplayUrl​(String displayUrl)

        URL to display for the result.

        Initially identical to indexUrl and liveUrl, but might have been transformed by a hook script. This URL can be used to display a different URL from the actual one, while preserving the liveUrl for the user to access the result.

        In the default form, this URL is displayed in the <cite> block for the the result

      • getClickTrackingUrl

        public String getClickTrackingUrl()
        URL for click tracking.
      • setClickTrackingUrl

        public void setClickTrackingUrl​(String clickTrackingUrl)
        URL for click tracking.
      • getExplain

        public Explain getExplain()
        Explain data used in the Content Optimiser.
      • setExplain

        public void setExplain​(Explain explain)
        Explain data used in the Content Optimiser.
      • getIndexUrl

        public String getIndexUrl()
        Original URL from the index, taken from indexUrl before any transformation.
      • setIndexUrl

        public void setIndexUrl​(String indexUrl)
        Original URL from the index, taken from indexUrl before any transformation.
      • getGscopesSet

        public Set<String> getGscopesSet()
        Set of GScope Numbers that this result has.
      • setGscopesSet

        public void setGscopesSet​(Set<String> gscopesSet)
        Set of GScope Numbers that this result has.
      • getCustomData

        public Map<String,​Object> getCustomData()
        Custom data placeholder allowing any arbitrary data to be stored by hook scripts.
      • getRelatedDocuments

        public Map<String,​Set<RelatedDocument>> getRelatedDocuments()
        Documents related to this result which have been fetched by RelatedDocumentFetcher. The map key is chosen by the related document fetching configuration and the set of related documents are those that were fetched based on the metadata relationships traversed by the configuration.
        Since:
        15.16
      • isDocumentVisibleToUser

        public boolean isDocumentVisibleToUser()
      • setDocumentVisibleToUser

        public void setDocumentVisibleToUser​(boolean documentVisibleToUser)
      • isPromoted

        public boolean isPromoted()
        Set true if the URL was promoted using -promote_urls.
        Since:
        15.12
      • setPromoted

        public void setPromoted​(boolean promoted)
        Set true if the URL was promoted using -promote_urls.
        Since:
        15.12
      • isDiversified

        public boolean isDiversified()
        Set true if the URL was down weighted by result diversification. This might happen from same site suppression (SSS).
        Since:
        15.12
      • setDiversified

        public void setDiversified​(boolean diversified)
        Set true if the URL was down weighted by result diversification. This might happen from same site suppression (SSS).
        Since:
        15.12