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 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 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 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 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 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 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 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

      • metadataSums

        private 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.
      • getDetails

        public Details getDetails()
        Details about the index and PADRE version.
      • setDetails

        public void setDetails​(Details details)
        Details about the index and PADRE version.
      • getQuery

        public String getQuery()
        Original query terms
      • setQuery

        public void setQuery​(String query)
        Original query terms
      • getQueryAsProcessed

        public String getQueryAsProcessed()

        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.

      • setQueryAsProcessed

        public void setQueryAsProcessed​(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.

      • getQueryRaw

        public String getQueryRaw()

        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.

      • setQueryRaw

        public void setQueryRaw​(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.

      • getQuerySystemRaw

        public String getQuerySystemRaw()

        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.

      • setQuerySystemRaw

        public void setQuerySystemRaw​(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.

      • getQueryCleaned

        public String getQueryCleaned()
        The query, cleaned from any operator or constraint that was automatically added by the faceted navigation system.
      • setQueryCleaned

        public void setQueryCleaned​(String queryCleaned)
        The query, cleaned from any operator or constraint that was automatically added by the faceted navigation system.
      • getCollection

        public String getCollection()
        ID of the collection being searched.
      • setCollection

        public void setCollection​(String collection)
        ID of the collection being searched.
      • getQSups

        public List<QSup> getQSups()

        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
      • getResultsSummary

        public ResultsSummary getResultsSummary()
        Summary counts and data about the results (How many documents matched, which page is currently returned, etc.).
      • setResultsSummary

        public void setResultsSummary​(ResultsSummary resultsSummary)
        Summary counts and data about the results (How many documents matched, which page is currently returned, etc.).
      • getSpell

        public Spell getSpell()
        Spelling suggestions.
      • setSpell

        public void setSpell​(Spell spell)
        Spelling suggestions.
      • getResults

        public List<Result> getResults()
        List of results.
      • getTierBars

        public List<TierBar> getTierBars()
        List of tier bars
      • getError

        public Error getError()
        Error occurred during the search, if any.
      • setError

        public void setError​(Error error)
        Error occurred during the search, if any.
      • getPadreElapsedTime

        public Integer getPadreElapsedTime()
        Time spent by PADRE processing the query, in milliseconds
      • setPadreElapsedTime

        public void setPadreElapsedTime​(Integer padreElapsedTime)
        Time spent by PADRE processing the query, in milliseconds
      • getPhlusterElapsedTime

        public Float getPhlusterElapsedTime()
        Time spent by PADRE processing contextual navigation, in seconds.
      • setPhlusterElapsedTime

        public void setPhlusterElapsedTime​(Float phlusterElapsedTime)
        Time spent by PADRE processing contextual navigation, in seconds.
      • getQueryProcessorCodes

        public String getQueryProcessorCodes()
        Indicates how the query was internally processed by PADRE.
      • setQueryProcessorCodes

        public void setQueryProcessorCodes​(String queryProcessorCodes)
        Indicates how the query was internally processed by PADRE.
      • getContextualNavigation

        public ContextualNavigation getContextualNavigation()
        Contextual navigation suggestions.
      • setContextualNavigation

        public void setContextualNavigation​(ContextualNavigation contextualNavigation)
        Contextual navigation suggestions.
      • getRmcs

        public Map<String,​Integer> getRmcs()

        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)
      • getRmcItemResults

        public Map<String,​List<RMCItemResult>> getRmcItemResults()

        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
      • getMetadataRanges

        public Map<String,​Range> getMetadataRanges()

        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)
      • getBoundingBoxes

        public Map<String,​GeoBoundingBox> getBoundingBoxes()

        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).

      • getUrlCounts

        public Map<String,​Integer> getUrlCounts()

        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
      • getGScopeCounts

        public Map<String,​Integer> getGScopeCounts()

        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.

      • getDateCounts

        public Map<String,​DateCount> getDateCounts()

        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
      • getQueryHighlightRegex

        public String getQueryHighlightRegex()

        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.

      • setQueryHighlightRegex

        public void setQueryHighlightRegex​(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.

      • getOrigin

        public Float[] getOrigin()

        Origin of the search, for geographical searches.

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

      • setOrigin

        public void setOrigin​(Float[] origin)

        Origin of the search, for geographical searches.

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

      • getEntityList

        public Map<String,​Integer> getEntityList()

        List of prominent entities.

        See the experimental -fluent query processor option.

      • getIncludeScopes

        public List<String> getIncludeScopes()
        Scopes (URL prefixes, not Gscope) included via the scope query processor option.
      • getExcludeScopes

        public List<String> getExcludeScopes()
        Scopes (URL prefixes, not Gscopes) excluded via the scope query processor option.
      • getCoolerWeights

        public Map<CoolerWeighting,​Float> getCoolerWeights()
        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.
      • getExplainTypes

        public Map<CoolerWeighting,​String> getExplainTypes()

        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.

      • getStopWords

        public List<String> getStopWords()
        A List of stop words used by the query processor. Only populated when explain mode is on.
      • getStemmedEquivs

        public com.google.common.collect.SetMultimap<String,​String> getStemmedEquivs()
        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.
      • getCoolerNames

        public Map<CoolerWeighting,​String> getCoolerNames()
        A Map of long names for cooler ranking variables, keyed by the cooler variable short names + id. Only populated when explain mode is on.
      • getSvgs

        public Map<String,​String> getSvgs()

        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
      • getUniqueCountsByGroups

        public List<UniqueByGroup> getUniqueCountsByGroups()

        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
      • getSumByGroups

        public List<SumByGroup> getSumByGroups()

        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'

      • getIndexedTermCounts

        public List<IndexedTermCounts> getIndexedTermCounts()

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

        See query processor option -countIndexedTerms.

        Since:
        15.10
      • getDocumentsPerCollection

        public Map<String,​Long> getDocumentsPerCollection()

        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

      • getMetadataSums

        public Map<String,​Double> getMetadataSums()

        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.