Class Q


  • public final class Q
    extends java.lang.Object
    Helper class for generating Vespa search queries https://docs.vespa.ai/documentation/reference/query-language-reference.html
    • Constructor Summary

      Constructors 
      Constructor Description
      Q()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DotProduct dotPdt​(java.lang.String field, java.util.Map<java.lang.String,​java.lang.Integer> weightedSet)
      dotPdt represents "dotProduct".
      static NonEmpty nonEmpty​(Query query)
      NonEmpty non empty.
      static Query p()
      P represents "parentheses", used for generated a query in the parentheses.
      static Query p​(QueryChain query)
      P represents "parentheses", used for generated a query in the parentheses.
      static Field p​(java.lang.String fieldName)
      P represents "parentheses", used for generated a query in the parentheses.
      static Rank rank​(Query query, Query... ranks)
      Rank rank.
      static Select select​(java.lang.String fieldName)  
      static Select select​(java.lang.String fieldName, java.lang.String... others)  
      static UserInput ui​(Annotation a, java.lang.String value)
      userInput with an annotation.
      static UserInput ui​(java.lang.String value)
      UI represents "userInput".
      static UserInput ui​(java.lang.String index, java.lang.String value)
      A convenience method to generate userInput with default index annotation.
      static Wand wand​(java.lang.String field, java.util.List<java.util.List<java.lang.Integer>> numericRange)
      Wand wand.
      static Wand wand​(java.lang.String field, java.util.Map<java.lang.String,​java.lang.Integer> weightedSet)
      Wand wand.
      static WeakAnd weakand​(java.lang.String field, Query query)
      Weakand weak and.
      static WeightedSet wtdSet​(java.lang.String field, java.util.Map<java.lang.String,​java.lang.Integer> weightedSet)
      wtdSet represents "weightedSet".
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Q

        public Q()
    • Method Detail

      • select

        public static Select select​(java.lang.String fieldName)
      • select

        public static Select select​(java.lang.String fieldName,
                                    java.lang.String... others)
      • p

        public static Field p​(java.lang.String fieldName)
        P represents "parentheses", used for generated a query in the parentheses.
        Parameters:
        fieldName - the field name
        Returns:
        the field
      • p

        public static Query p​(QueryChain query)
        P represents "parentheses", used for generated a query in the parentheses.
        Parameters:
        query - the query
        Returns:
        the query
      • p

        public static Query p()
        P represents "parentheses", used for generated a query in the parentheses. This method generates an empty query
        Returns:
        the empty query
      • rank

        public static Rank rank​(Query query,
                                Query... ranks)
        Rank rank. https://docs.vespa.ai/documentation/reference/query-language-reference.html#rank
        Parameters:
        query - the query
        ranks - the ranks
        Returns:
        the rank query
      • ui

        public static UserInput ui​(java.lang.String value)
        UI represents "userInput". https://docs.vespa.ai/documentation/reference/query-language-reference.html#userinput
        Parameters:
        value - the value
        Returns:
        the user input query
      • ui

        public static UserInput ui​(Annotation a,
                                   java.lang.String value)
        userInput with an annotation. https://docs.vespa.ai/documentation/reference/query-language-reference.html#userinput
        Parameters:
        a - the a
        value - the value
        Returns:
        the user input query
      • ui

        public static UserInput ui​(java.lang.String index,
                                   java.lang.String value)
        A convenience method to generate userInput with default index annotation. https://docs.vespa.ai/documentation/reference/query-language-reference.html#userinput
        Parameters:
        index - the index
        value - the value
        Returns:
        the user input query
      • dotPdt

        public static DotProduct dotPdt​(java.lang.String field,
                                        java.util.Map<java.lang.String,​java.lang.Integer> weightedSet)
        dotPdt represents "dotProduct". https://docs.vespa.ai/documentation/reference/query-language-reference.html#dotproduct
        Parameters:
        field - the field
        weightedSet - the weighted set
        Returns:
        the dot product query
      • wtdSet

        public static WeightedSet wtdSet​(java.lang.String field,
                                         java.util.Map<java.lang.String,​java.lang.Integer> weightedSet)
        wtdSet represents "weightedSet". https://docs.vespa.ai/documentation/reference/query-language-reference.html#weightedset
        Parameters:
        field - the field
        weightedSet - the weighted set
        Returns:
        the weighted set query
      • nonEmpty

        public static NonEmpty nonEmpty​(Query query)
        NonEmpty non empty. https://docs.vespa.ai/documentation/reference/query-language-reference.html#nonempty
        Parameters:
        query - the query
        Returns:
        the non empty query
      • wand

        public static Wand wand​(java.lang.String field,
                                java.util.Map<java.lang.String,​java.lang.Integer> weightedSet)
        Wand wand. https://docs.vespa.ai/documentation/reference/query-language-reference.html#wand
        Parameters:
        field - the field
        weightedSet - the weighted set
        Returns:
        the wand query
      • wand

        public static Wand wand​(java.lang.String field,
                                java.util.List<java.util.List<java.lang.Integer>> numericRange)
        Wand wand. https://docs.vespa.ai/documentation/reference/query-language-reference.html#wand
        Parameters:
        field - the field
        numericRange - the numeric range
        Returns:
        the wand query
      • weakand

        public static WeakAnd weakand​(java.lang.String field,
                                      Query query)
        Weakand weak and. https://docs.vespa.ai/documentation/reference/query-language-reference.html#weakand
        Parameters:
        field - the field
        query - the query
        Returns:
        the weak and query