Class Query

Direct Known Subclasses:
UserInput

public class Query extends QueryChain
Vespa query object
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • and

      public Field and(String fieldName)
      And. https://docs.vespa.ai/en/reference/query-language-reference.html#and
      Parameters:
      fieldName - the field name
      Returns:
      the field
    • andnot

      public Field andnot(String fieldName)
      Andnot. https://docs.vespa.ai/en/reference/query-language-reference.html#andnot
      Parameters:
      fieldName - the field name
      Returns:
      the field
    • or

      public Field or(String fieldName)
      Or. https://docs.vespa.ai/en/reference/query-language-reference.html#or
      Parameters:
      fieldName - the field name
      Returns:
      the field
    • and

      public Query and(QueryChain query)
      And. https://docs.vespa.ai/en/reference/query-language-reference.html#and
      Parameters:
      query - the query
      Returns:
      the query
    • andnot

      public Query andnot(QueryChain query)
      Andnot. https://docs.vespa.ai/en/reference/query-language-reference.html#andnot
      Parameters:
      query - the query
      Returns:
      the query
    • or

      public Query or(QueryChain query)
      Or. https://docs.vespa.ai/en/reference/query-language-reference.html#or
      Parameters:
      query - the query
      Returns:
      the query
    • annotate

      public Query annotate(Annotation annotation)
      Annotate a query (sub-expression). https://docs.vespa.ai/en/reference/query-language-reference.html#annotations-of-sub-expressions
      Parameters:
      annotation - the annotation
      Returns:
      the query
    • offset

      public EndQuery offset(int offset)
      Offset. https://docs.vespa.ai/en/reference/query-language-reference.html#limit-offset
      Parameters:
      offset - the offset
      Returns:
      the end query
    • limit

      public EndQuery limit(int hits)
      Limit. https://docs.vespa.ai/en/reference/query-language-reference.html#limit-offset
      Parameters:
      hits - the hits
      Returns:
      the end query
    • timeout

      public EndQuery timeout(int timeout)
      Timeout. https://docs.vespa.ai/en/reference/query-language-reference.html#timeout
      Parameters:
      timeout - the timeout
      Returns:
      the end query
    • group

      public EndQuery group(Group group)
      Group. https://docs.vespa.ai/en/reference/query-language-reference.html#grouping
      Parameters:
      group - the group
      Returns:
      the end query
    • group

      public EndQuery group(String groupStr)
      Group. https://docs.vespa.ai/en/reference/query-language-reference.html#grouping
      Parameters:
      groupStr - the group str
      Returns:
      the end query
    • orderByAsc

      public EndQuery orderByAsc(String fieldName)
      Order by asc. https://docs.vespa.ai/en/reference/query-language-reference.html#order-by
      Parameters:
      fieldName - the field name
      Returns:
      the end query
    • orderByAsc

      public EndQuery orderByAsc(Annotation annotation, String fieldName)
      Order by asc. https://docs.vespa.ai/en/reference/query-language-reference.html#order-by
      Parameters:
      annotation - the annotation
      fieldName - the field name
      Returns:
      the end query
    • orderByDesc

      public EndQuery orderByDesc(String fieldName)
      Order by desc. https://docs.vespa.ai/en/reference/query-language-reference.html#order-by
      Parameters:
      fieldName - the field name
      Returns:
      the end query
    • orderByDesc

      public EndQuery orderByDesc(Annotation annotation, String fieldName)
      Order by desc. https://docs.vespa.ai/en/reference/query-language-reference.html#order-by
      Parameters:
      annotation - the annotation
      fieldName - the field name
      Returns:
      the end query
    • semicolon

      @Deprecated public FixedQuery semicolon()
      Deprecated.
      use fix(), end() or build() instead
      Calls fix()
      Returns:
      the fixed query
    • end

      public EndQuery end()
      Returns this as an ended query.
    • fix

      public FixedQuery fix()
      Calls end().fix().
    • build

      public String build()
      Calls fix().build().
    • getSources

      public Sources getSources()
    • setSources

      public void setSources(Sources sources)
    • getQuery

      public Query getQuery()
    • getSelect

      public Select getSelect()
    • hasPositiveSearchField

      public boolean hasPositiveSearchField(String fieldName)
    • hasPositiveSearchField

      public boolean hasPositiveSearchField(String fieldName, Object value)
    • hasNegativeSearchField

      public boolean hasNegativeSearchField(String fieldName)
    • hasNegativeSearchField

      public boolean hasNegativeSearchField(String fieldName, Object value)