Class ResultPacket


  • public class ResultPacket
    extends Object
    A PADRE result packet, containing search results.
    Since:
    11.0
    • Field Detail

      • details

        private Details details
        Details about the index and PADRE version.
      • query

        private String query
        Original query terms
      • queryAsProcessed

        private String queryAsProcessed

        Query terms as processed by PADRE.

        This could be different from the query if the initial query contained character that PADRE ignores of if a query transformation was applied by PADRE.

      • queryRaw

        private String queryRaw

        Query terms as provided to PADRE by the user.

        The query at this point has been encoded to UTF8, possibly there may have been percent decoding if query processor option udcq is used. The value is otherwise unmodified.

      • querySystemRaw

        private String querySystemRaw

        System-generated query terms as provided to PADRE.

        The query separately provided by the system using the processor option or CGI parameter s. This value has been UTF8 encoded, otherwise it is unchanged. It is ultimately preprocessed and concatenated to the preprocessed user query and parsed.

      • queryCleaned

        private String queryCleaned
        The query, cleaned from any operator or constraint that was automatically added by the faceted navigation system.
      • collection

        private String collection
        ID of the collection being searched.
      • qSups

        private final List<QSup> qSups

        List of additional queries for the Query Blending system.

        Warning: When accessing this field from a template or a hook script you must use the following syntax: QSups, instead of qSups due to the Javabeans naming conventions.

        See Also:
        "blending.cfg"
      • resultsSummary

        private ResultsSummary resultsSummary
        Summary counts and data about the results (How many documents matched, which page is currently returned, etc.).
      • spell

        private Spell spell
        Spelling suggestions.
      • results

        private final List<Result> results
        List of results.
      • tierBars

        private final List<TierBar> tierBars
        List of tier bars
      • error

        private Error error
        Error occurred during the search, if any.
      • padreElapsedTime

        private Integer padreElapsedTime
        Time spent by PADRE processing the query, in milliseconds
      • phlusterElapsedTime

        private Float phlusterElapsedTime
        Time spent by PADRE processing contextual navigation, in seconds.
      • queryProcessorCodes

        private String queryProcessorCodes
        Indicates how the query was internally processed by PADRE.
      • contextualNavigation

        private ContextualNavigation contextualNavigation
        Contextual navigation suggestions.
      • rmcs

        private final Map<String,​Integer> rmcs

        Metadata counts (Used in faceted navigation).

        The key is the tuple metadata_class:value and the value is the count.

        Examples:

        • a:mozart => 12
        • a:beethoven => 6
        • -a: => 10 (i.e. items with no a metadata)
      • rmcItemResults

        private final Map<String,​List<RMCItemResult>> rmcItemResults

        Metadata counts (Used in faceted navigation) including top n results for each count.

        The key is the couple of metadata_class:value. The value is a list of the first n results that would be returned if the metadata constraint was applied.

        The key is the same one as the rmcs map.

        Examples:

        • a:shakespeare =>
          • Romeo and Juliet
          • Cleopatra
          • ...
        • a:voltaire =>
          • Zadig
          • ...
        Since:
        11.2
      • metadataRanges

        private final Map<String,​Range> metadataRanges

        Metadata ranges.

        The key is the metadata_class and the value is a DoubleRange object with maximum and minimum values.

        Example:

        • P => Range(100.0, 400.0)
      • boundingBoxes

        public Map<String,​GeoBoundingBox> boundingBoxes

        Bounding boxes for Geospatial metadata classes

        The key is the metadata_class and the value is the bounding box for the coordinates for that class that appeared in the results (up to the DAAT limit).

      • urlCounts

        private final Map<String,​Integer> urlCounts

        URL counts (Used in faceted navigation).

        The key is the URL itself and the value is the count. If the URL starts with http://, it's omitted.

        Examples:

        • www.example.com/about => 12
        • www.example.com/contact => 6
        • https://secure.example.com/login => 5
      • gScopeCounts

        private final Map<String,​Integer> gScopeCounts

        GScope counts (Used in faceted navigation)

        The key is the GScope number and the value is the count.

        Warning: When accessing this field from a template or a hook script you must use the following syntax: GScopeCounts, instead of gScopeCounts due to the Javabeans naming conventions.

      • dateCounts

        private final Map<String,​DateCount> dateCounts

        Date counts (Used in faceted navigation)

        The key is a tuple metadata_class:value, with the value being a year or a label, e.g. d:2003 or d:Yesterday.

        Since:
        12.0
      • queryHighlightRegex

        private String queryHighlightRegex

        Regular expression to use to highlight query terms in titles, summaries or metadata.

        PADRE provides the regular expression to use depending on the query terms and other factors.

      • origin

        private Float[] origin

        Origin of the search, for geographical searches.

        The first slot contains the latitude, the second slot contains the longitude.

      • entityList

        private final Map<String,​Integer> entityList

        List of prominent entities.

        See the experimental -fluent query processor option.

      • includeScopes

        private final List<String> includeScopes
        Scopes (URL prefixes, not Gscope) included via the scope query processor option.
      • excludeScopes

        private final List<String> excludeScopes
        Scopes (URL prefixes, not Gscopes) excluded via the scope query processor option.
      • coolerWeights

        private final Map<CoolerWeighting,​Float> coolerWeights
        A Map of floats that describe the cooler ranking weights. Weights are identified by the cooler variable short name + id, and the map is only populated when explain mode is on.
      • explainTypes

        private final Map<CoolerWeighting,​String> explainTypes

        A Map of Strings that describes how to calculate the potential improvement for ranking on each feature when the content optimiser is used.

        Ranking features are identified by the cooler variable short name + id, and the map is only populated when explain mode is on.

      • stopWords

        private final List<String> stopWords
        A List of stop words used by the query processor. Only populated when explain mode is on.
      • stemmedEquivs

        private final com.google.common.collect.SetMultimap<String,​String> stemmedEquivs
        A SetMultimap of Strings that describes the results of stemming on the query. Only populated when explain mode is on. The map keys are content terms, and the value(s) are the query terms that the key matches.
      • coolerNames

        private final Map<CoolerWeighting,​String> coolerNames
        A Map of long names for cooler ranking variables, keyed by the cooler variable short names + id. Only populated when explain mode is on.
      • svgs

        private final Map<String,​String> svgs

        Contains SVG data returned by PADRE, for example an SVG representation of the syntax tree.

        The value contains the actual SVG XML string which can be directly used in an HTML source for browsers that supports it.

        Since:
        12.0
      • uniqueCountsByGroups

        private final List<UniqueByGroup> uniqueCountsByGroups

        A list containing the count of unique values for a metadata class grouped by another metadata class.

        Each element of the list is the result of the count of unique values of metadata 'X' grouped by metadata 'Y'.

        Since:
        15.8
      • sumByGroups

        private final List<SumByGroup> sumByGroups

        A list containing the sum of a numeric metadata class grouped by another metadata class

        Each element of the list is the result of the sum of metadata 'X' grouped by metadata 'Y'

      • indexedTermCounts

        private final List<IndexedTermCounts> indexedTermCounts

        A list containing the counts of term occurrences in a metadata class.

        See query processor option -countIndexedTerms.

        Since:
        15.10
      • documentsPerCollection

        private final Map<String,​Long> documentsPerCollection

        A map containing the number of documents each collection contributed to the result set.

        The key is the collection name and the value is the number of documents that collection contributed

        Since:
        15.12
      • metadataSums

        private final Map<String,​Double> metadataSums

        A map of the numeric metadata to total of that numeric metadata in the result set

        The key is the metadata class. The value is the sum.

    • Constructor Detail

      • ResultPacket

        public ResultPacket()
    • Method Detail

      • hasResults

        public boolean hasResults()
        Test if the packet contains results.
        Returns:
        true if the packet contains at least one Result.
      • getResultsWithTierBars

        public List<ResultType> getResultsWithTierBars()

        Get the results and the tier bars mixed together.

        This is a convenience method if you need to iterate over the result set and display tier bars.

        Returns:
        A list containing both Result and TierBar, in the order returned by PADRE.