Class QueryOptions.Builder

java.lang.Object
com.ibm.watson.discovery.v2.model.QueryOptions.Builder
Enclosing class:
QueryOptions

public static class QueryOptions.Builder
extends Object
Builder.
  • Constructor Details

    • Builder

      public Builder()
      Instantiates a new builder.
    • Builder

      public Builder​(String projectId)
      Instantiates a new builder with required properties.
      Parameters:
      projectId - the projectId
  • Method Details

    • build

      public QueryOptions build()
      Builds a QueryOptions.
      Returns:
      the new QueryOptions instance
    • addCollectionIds

      public QueryOptions.Builder addCollectionIds​(String collectionIds)
      Adds an collectionIds to collectionIds.
      Parameters:
      collectionIds - the new collectionIds
      Returns:
      the QueryOptions builder
    • addReturnField

      public QueryOptions.Builder addReturnField​(String returnField)
      Adds an returnField to xReturn.
      Parameters:
      returnField - the new returnField
      Returns:
      the QueryOptions builder
    • projectId

      public QueryOptions.Builder projectId​(String projectId)
      Set the projectId.
      Parameters:
      projectId - the projectId
      Returns:
      the QueryOptions builder
    • collectionIds

      public QueryOptions.Builder collectionIds​(List<String> collectionIds)
      Set the collectionIds. Existing collectionIds will be replaced.
      Parameters:
      collectionIds - the collectionIds
      Returns:
      the QueryOptions builder
    • filter

      public QueryOptions.Builder filter​(String filter)
      Set the filter.
      Parameters:
      filter - the filter
      Returns:
      the QueryOptions builder
    • query

      public QueryOptions.Builder query​(String query)
      Set the query.
      Parameters:
      query - the query
      Returns:
      the QueryOptions builder
    • naturalLanguageQuery

      public QueryOptions.Builder naturalLanguageQuery​(String naturalLanguageQuery)
      Set the naturalLanguageQuery.
      Parameters:
      naturalLanguageQuery - the naturalLanguageQuery
      Returns:
      the QueryOptions builder
    • aggregation

      public QueryOptions.Builder aggregation​(String aggregation)
      Set the aggregation.
      Parameters:
      aggregation - the aggregation
      Returns:
      the QueryOptions builder
    • count

      public QueryOptions.Builder count​(long count)
      Set the count.
      Parameters:
      count - the count
      Returns:
      the QueryOptions builder
    • xReturn

      public QueryOptions.Builder xReturn​(List<String> xReturn)
      Set the xReturn. Existing xReturn will be replaced.
      Parameters:
      xReturn - the xReturn
      Returns:
      the QueryOptions builder
    • offset

      public QueryOptions.Builder offset​(long offset)
      Set the offset.
      Parameters:
      offset - the offset
      Returns:
      the QueryOptions builder
    • sort

      public QueryOptions.Builder sort​(String sort)
      Set the sort.
      Parameters:
      sort - the sort
      Returns:
      the QueryOptions builder
    • highlight

      public QueryOptions.Builder highlight​(Boolean highlight)
      Set the highlight.
      Parameters:
      highlight - the highlight
      Returns:
      the QueryOptions builder
    • spellingSuggestions

      public QueryOptions.Builder spellingSuggestions​(Boolean spellingSuggestions)
      Set the spellingSuggestions.
      Parameters:
      spellingSuggestions - the spellingSuggestions
      Returns:
      the QueryOptions builder
    • tableResults

      public QueryOptions.Builder tableResults​(QueryLargeTableResults tableResults)
      Set the tableResults.
      Parameters:
      tableResults - the tableResults
      Returns:
      the QueryOptions builder
    • suggestedRefinements

      public QueryOptions.Builder suggestedRefinements​(QueryLargeSuggestedRefinements suggestedRefinements)
      Set the suggestedRefinements.
      Parameters:
      suggestedRefinements - the suggestedRefinements
      Returns:
      the QueryOptions builder
    • passages

      public QueryOptions.Builder passages​(QueryLargePassages passages)
      Set the passages.
      Parameters:
      passages - the passages
      Returns:
      the QueryOptions builder