Class SearchRequest

java.lang.Object
com.microsoft.graph.models.SearchRequest
All Implemented Interfaces:
com.microsoft.graph.serializer.IJsonBackedObject

public class SearchRequest extends Object implements com.microsoft.graph.serializer.IJsonBackedObject
The class for the Search Request.
  • Field Details

    • oDataType

      @SerializedName("@odata.type") @Expose @Nullable public String oDataType
      the OData type of the object as returned by the service
    • aggregationFilters

      @SerializedName(value="aggregationFilters", alternate="AggregationFilters") @Expose @Nullable public List<String> aggregationFilters
      The Aggregation Filters. Contains one or more filters to obtain search results aggregated and filtered to a specific value of a field. Optional.Build this filter based on a prior search that aggregates by the same field. From the response of the prior search, identify the searchBucket that filters results to the specific value of the field, use the string in its aggregationFilterToken property, and build an aggregation filter string in the format '{field}:/'{aggregationFilterToken}/''. If multiple values for the same field need to be provided, use the strings in its aggregationFilterToken property and build an aggregation filter string in the format '{field}:or(/'{aggregationFilterToken1}/',/'{aggregationFilterToken2}/')'. For example, searching and aggregating drive items by file type returns a searchBucket for the file type docx in the response. You can conveniently use the aggregationFilterToken returned for this searchBucket in a subsequent search query and filter matches down to drive items of the docx file type. Example 1 and example 2 show the actual requests and responses.
    • aggregations

      @SerializedName(value="aggregations", alternate="Aggregations") @Expose @Nullable public List<AggregationOption> aggregations
      The Aggregations. Specifies aggregations (also known as refiners) to be returned alongside search results. Optional.
    • collapseProperties

      @SerializedName(value="collapseProperties", alternate="CollapseProperties") @Expose @Nullable public List<CollapseProperty> collapseProperties
      The Collapse Properties. Contains the ordered collection of fields and limit to collapse results. Optional.
    • contentSources

      @SerializedName(value="contentSources", alternate="ContentSources") @Expose @Nullable public List<String> contentSources
      The Content Sources. Contains the connection to be targeted.
    • enableTopResults

      @SerializedName(value="enableTopResults", alternate="EnableTopResults") @Expose @Nullable public Boolean enableTopResults
      The Enable Top Results. This triggers hybrid sort for messages : the first 3 messages are the most relevant. This property is only applicable to entityType=message. Optional.
    • entityTypes

      @SerializedName(value="entityTypes", alternate="EntityTypes") @Expose @Nullable public List<EntityType> entityTypes
      The Entity Types. One or more types of resources expected in the response. Possible values are: event, message, driveItem, externalItem, site, list, listItem, drive, chatMessage, person, acronym, bookmark. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum:chatMessage, person, acronym, bookmark. See known limitations for those combinations of two or more entity types that are supported in the same search request. Required.
    • fields

      @SerializedName(value="fields", alternate="Fields") @Expose @Nullable public List<String> fields
      The Fields. Contains the fields to be returned for each resource object specified in entityTypes, allowing customization of the fields returned by default; otherwise, including additional fields such as custom managed properties from SharePoint and OneDrive, or custom fields in externalItem from the content that Microsoft Graph connectors bring in. The fields property can use the semantic labels applied to properties. For example, if a property is labeled as title, you can retrieve it using the following syntax: label_title. Optional.
    • from

      @SerializedName(value="from", alternate="From") @Expose @Nullable public Integer from
      The From. Specifies the offset for the search results. Offset 0 returns the very first result. Optional.
    • query

      @SerializedName(value="query", alternate="Query") @Expose @Nullable public SearchQuery query
      The Query. Contains the query terms. Required.
    • queryAlterationOptions

      @SerializedName(value="queryAlterationOptions", alternate="QueryAlterationOptions") @Expose @Nullable public SearchAlterationOptions queryAlterationOptions
      The Query Alteration Options. Query alteration options formatted in a JSON blob that contains two optional flags related to spelling correction. Optional.
    • region

      @SerializedName(value="region", alternate="Region") @Expose @Nullable public String region
      The Region. The geographic location for the search. Required for searches that use application permissions. For details, see Get the region value.
    • resultTemplateOptions

      @SerializedName(value="resultTemplateOptions", alternate="ResultTemplateOptions") @Expose @Nullable public ResultTemplateOption resultTemplateOptions
      The Result Template Options. Provides the search result template options to render search results from connectors.
    • sharePointOneDriveOptions

      @SerializedName(value="sharePointOneDriveOptions", alternate="SharePointOneDriveOptions") @Expose @Nullable public SharePointOneDriveOptions sharePointOneDriveOptions
      The Share Point One Drive Options. Indicates the kind of contents to be searched when a search is performed using application permissions. Optional.
    • size

      @SerializedName(value="size", alternate="Size") @Expose @Nullable public Integer size
      The Size. The size of the page to be retrieved. The maximum value is 500. Optional.
    • sortProperties

      @SerializedName(value="sortProperties", alternate="SortProperties") @Expose @Nullable public List<SortProperty> sortProperties
      The Sort Properties. Contains the ordered collection of fields and direction to sort results. There can be at most 5 sort properties in the collection. Optional.
  • Constructor Details

    • SearchRequest

      public SearchRequest()
  • Method Details

    • additionalDataManager

      @Nonnull public final com.microsoft.graph.serializer.AdditionalDataManager additionalDataManager()
      Specified by:
      additionalDataManager in interface com.microsoft.graph.serializer.IJsonBackedObject
    • setRawObject

      public void setRawObject(@Nonnull com.microsoft.graph.serializer.ISerializer serializer, @Nonnull com.google.gson.JsonObject json)
      Sets the raw JSON object
      Specified by:
      setRawObject in interface com.microsoft.graph.serializer.IJsonBackedObject
      Parameters:
      serializer - the serializer
      json - the JSON object to set this object to