Class QueryDefinition

    • Constructor Detail

      • QueryDefinition

        public QueryDefinition​(Query main,
                               java.util.List<BoostByValue> boostsByValues,
                               java.util.List<BoostQuery> boostsByQuery,
                               java.util.List<FunctionQuery> boostsByFunction,
                               java.util.List<java.lang.String> boostsByDocId,
                               java.lang.String userQuery,
                               java.util.List<Query> filters,
                               java.util.List<NamedFilter> namedFilters,
                               Query groupedQuery,
                               java.util.List<Query> groupedFilters)
    • Method Detail

      • getMain

        public Query getMain()
        Returns:
        main query that defines the base result set and document scores for this request. If null, defaults to TextQuery with getUserQuery() value
      • setMain

        public void setMain​(Query main)
      • getBoostsByValues

        public java.util.List<BoostByValue> getBoostsByValues()
        Returns:
        a list of fields and boost values that will be used in combination with getBoostsByQuery() and will be added to getMain() to influence the score. Boosts by query and value have no impact on the result set.
      • getBoostsByQuery

        public java.util.List<BoostQuery> getBoostsByQuery()
        Returns:
        a list of additional queries that that will be used in combination with getBoostsByValues() and will be added to getMain() to influence the score. Boosts by query and value have no impact on the result set.
      • getBoostsByFunction

        public java.util.List<FunctionQuery> getBoostsByFunction()
      • getUserQuery

        public java.lang.String getUserQuery()
        Returns:
        actual user query that is used in combination with getMain()
      • getFilters

        public java.util.List<Query> getFilters()
        Returns:
        a list of filter queries used to narrow the base result set. Filters have no impact on document scoring.
      • getNamedFilters

        public java.util.List<NamedFilter> getNamedFilters()
        Filters with associated names. These filters are treated identically to the values in getFilters() - they are used to narrow the base result set and have no impact on scoring. Additionally however, filters in this list are paired with names that allow them to be manipulated by other features. See FacetDomain.getExcludedFiltersByName() for an example.
      • setFilters

        public void setFilters​(java.util.List<Query> filters)
      • addFilter

        public void addFilter​(Query filter)
      • setBoostsByValues

        public void setBoostsByValues​(java.util.List<BoostByValue> boostsByValues)
      • addBoostByValues

        public void addBoostByValues​(BoostByValue boostByValues)
      • getGroupedQuery

        public Query getGroupedQuery()
        Returns:
        overrides getMain() for group details. Results.getGroup() has to be set

        This field is ignored with "hint.grouping.method=group".

      • getGroupedFilters

        public java.util.List<Query> getGroupedFilters()
        Returns:
        overrides getFilters() for group details. Results.getGroup() has to be set

        This field is ignored with "hint.grouping.method=group".

      • setBoostsByQuery

        public void setBoostsByQuery​(java.util.List<BoostQuery> boostsByQuery)
      • addBoostByQuery

        public void addBoostByQuery​(BoostQuery boostQuery)
      • getBoostsByDocId

        public java.util.List<java.lang.String> getBoostsByDocId()
        Returns:
        A list of Solr document IDs which will be boosted to the top of the query results, if they match, using the Query Elevation Component in Solr
      • setBoostsByDocId

        public void setBoostsByDocId​(java.util.List<java.lang.String> boostsByDocId)
      • addBoostByDocId

        public void addBoostByDocId​(java.lang.String docId)