Class Result.ResultBuilder

  • Enclosing class:
    Result

    public static class Result.ResultBuilder
    extends Object
    • Field Detail

      • collection

        private String collection
      • component

        private Integer component
      • liveUrl

        private String liveUrl
      • summary

        private String summary
      • allSummaryText

        private String allSummaryText
      • cacheUrl

        private String cacheUrl
      • date

        private Date date
      • fileSize

        private Integer fileSize
      • fileType

        private String fileType
      • exploreLink

        private String exploreLink
      • kmFromOrigin

        private Float kmFromOrigin
      • displayUrl

        private String displayUrl
      • clickTrackingUrl

        private String clickTrackingUrl
      • indexUrl

        private String indexUrl
      • documentVisibleToUser$set

        private boolean documentVisibleToUser$set
      • documentVisibleToUser$value

        private boolean documentVisibleToUser$value
      • promoted$set

        private boolean promoted$set
      • promoted$value

        private boolean promoted$value
      • diversified$set

        private boolean diversified$set
      • diversified$value

        private boolean diversified$value
    • Constructor Detail

      • ResultBuilder

        ResultBuilder()
    • Method Detail

      • collection

        public Result.ResultBuilder collection​(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.

        Returns:
        this.
      • component

        public Result.ResultBuilder component​(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.

        Returns:
        this.
        See Also:
        Result.collection
      • collapsed

        public Result.ResultBuilder collapsed​(Collapsed collapsed)

        Result collapsing information for this result.

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

        Returns:
        this.
        Since:
        12.5
      • liveUrl

        public Result.ResultBuilder liveUrl​(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.

        Returns:
        this.
      • allSummaryText

        public Result.ResultBuilder allSummaryText​(String allSummaryText)
        All texts available for generating summary text
        Returns:
        this.
        Since:
        15.18
      • cacheUrl

        public Result.ResultBuilder cacheUrl​(String cacheUrl)
        URL to access the cached version of the result.
        Returns:
        this.
      • fileSize

        public Result.ResultBuilder fileSize​(Integer fileSize)
        Size of the file corresponding to the search results, in bytes.
        Returns:
        this.
      • fileType

        public Result.ResultBuilder fileType​(String fileType)
        File type of the result, usually the file extension ("pdf", "xls", "html", ...)
        Returns:
        this.
      • kmFromOrigin

        public Result.ResultBuilder kmFromOrigin​(Float kmFromOrigin)
        Distance in kilometres of this search result from the origin set when the query is run.
        Returns:
        this.
      • displayUrl

        public Result.ResultBuilder displayUrl​(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

        Returns:
        this.
      • clickTrackingUrl

        public Result.ResultBuilder clickTrackingUrl​(String clickTrackingUrl)
        URL for click tracking.
        Returns:
        this.
      • indexUrl

        public Result.ResultBuilder indexUrl​(String indexUrl)
        Original URL from the index, taken from indexUrl before any transformation.
        Returns:
        this.
      • documentVisibleToUser

        public Result.ResultBuilder documentVisibleToUser​(boolean documentVisibleToUser)
        Returns:
        this.
      • promoted

        public Result.ResultBuilder promoted​(boolean promoted)
        Set true if the URL was promoted using -promote_urls.
        Returns:
        this.
        Since:
        15.12
      • diversified

        public Result.ResultBuilder diversified​(boolean diversified)
        Set true if the URL was down weighted by result diversification. This might happen from same site suppression (SSS).
        Returns:
        this.
        Since:
        15.12
      • build

        public Result build()