Class SearchRequest

java.lang.Object
com.microsoft.graph.models.SearchRequest
All Implemented Interfaces:
com.microsoft.kiota.serialization.AdditionalDataHolder, com.microsoft.kiota.serialization.Parsable, com.microsoft.kiota.store.BackedModel

@Generated("com.microsoft.kiota") public class SearchRequest extends Object implements com.microsoft.kiota.serialization.AdditionalDataHolder, com.microsoft.kiota.store.BackedModel, com.microsoft.kiota.serialization.Parsable
  • Field Details

    • backingStore

      @Nonnull protected com.microsoft.kiota.store.BackingStore backingStore
      Stores model information.
  • Constructor Details

    • SearchRequest

      public SearchRequest()
      Instantiates a new SearchRequest and sets the default values.
  • Method Details

    • createFromDiscriminatorValue

      @Nonnull public static SearchRequest createFromDiscriminatorValue(@Nonnull com.microsoft.kiota.serialization.ParseNode parseNode)
      Creates a new instance of the appropriate class based on discriminator value
      Parameters:
      parseNode - The parse node to use to read the discriminator value and create the object
      Returns:
      a SearchRequest
    • getAdditionalData

      @Nonnull public Map<String,Object> getAdditionalData()
      Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
      Specified by:
      getAdditionalData in interface com.microsoft.kiota.serialization.AdditionalDataHolder
      Returns:
      a Map<String,Object>
    • getAggregationFilters

      @Nullable public List<String> getAggregationFilters()
      Gets the aggregationFilters property value. 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.
      Returns:
      a List<String>
    • getAggregations

      @Nullable public List<AggregationOption> getAggregations()
      Gets the aggregations property value. Specifies aggregations (also known as refiners) to be returned alongside search results. Optional.
      Returns:
      a List<AggregationOption>
    • getBackingStore

      @Nonnull public com.microsoft.kiota.store.BackingStore getBackingStore()
      Gets the backingStore property value. Stores model information.
      Specified by:
      getBackingStore in interface com.microsoft.kiota.store.BackedModel
      Returns:
      a BackingStore
    • getCollapseProperties

      @Nullable public List<CollapseProperty> getCollapseProperties()
      Gets the collapseProperties property value. Contains the ordered collection of fields and limit to collapse results. Optional.
      Returns:
      a List<CollapseProperty>
    • getContentSources

      @Nullable public List<String> getContentSources()
      Gets the contentSources property value. Contains the connection to be targeted.
      Returns:
      a List<String>
    • getEnableTopResults

      @Nullable public Boolean getEnableTopResults()
      Gets the enableTopResults property value. This triggers hybrid sort for messages : the first 3 messages are the most relevant. This property is only applicable to entityType=message. Optional.
      Returns:
      a Boolean
    • getEntityTypes

      @Nullable public List<EntityType> getEntityTypes()
      Gets the entityTypes property value. 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. 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.
      Returns:
      a List<EntityType>
    • getFieldDeserializers

      @Nonnull public Map<String,Consumer<com.microsoft.kiota.serialization.ParseNode>> getFieldDeserializers()
      The deserialization information for the current model
      Specified by:
      getFieldDeserializers in interface com.microsoft.kiota.serialization.Parsable
      Returns:
      a Map<String,Consumer<com.microsoft.kiota.serialization.ParseNode>>
    • getFields

      @Nullable public List<String> getFields()
      Gets the fields property value. 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.
      Returns:
      a List<String>
    • getFrom

      @Nullable public Integer getFrom()
      Gets the from property value. Specifies the offset for the search results. Offset 0 returns the very first result. Optional.
      Returns:
      a Integer
    • getOdataType

      @Nullable public String getOdataType()
      Gets the @odata.type property value. The OdataType property
      Returns:
      a String
    • getQuery

      @Nullable public SearchQuery getQuery()
      Gets the query property value. The query property
      Returns:
      a SearchQuery
    • getQueryAlterationOptions

      @Nullable public SearchAlterationOptions getQueryAlterationOptions()
      Gets the queryAlterationOptions property value. Query alteration options formatted in a JSON blob that contains two optional flags related to spelling correction. Optional.
      Returns:
      a SearchAlterationOptions
    • getRegion

      @Nullable public String getRegion()
      Gets the region property value. The geographic location for the search. Required for searches that use application permissions. For details, see Get the region value.
      Returns:
      a String
    • getResultTemplateOptions

      @Nullable public ResultTemplateOption getResultTemplateOptions()
      Gets the resultTemplateOptions property value. Provides the search result template options to render search results from connectors.
      Returns:
      a ResultTemplateOption
    • getSharePointOneDriveOptions

      @Nullable public SharePointOneDriveOptions getSharePointOneDriveOptions()
      Gets the sharePointOneDriveOptions property value. Indicates the kind of contents to be searched when a search is performed using application permissions. Optional.
      Returns:
      a SharePointOneDriveOptions
    • getSize

      @Nullable public Integer getSize()
      Gets the size property value. The size of the page to be retrieved. The maximum value is 500. Optional.
      Returns:
      a Integer
    • getSortProperties

      @Nullable public List<SortProperty> getSortProperties()
      Gets the sortProperties property value. Contains the ordered collection of fields and direction to sort results. There can be at most 5 sort properties in the collection. Optional.
      Returns:
      a List<SortProperty>
    • serialize

      public void serialize(@Nonnull com.microsoft.kiota.serialization.SerializationWriter writer)
      Serializes information the current object
      Specified by:
      serialize in interface com.microsoft.kiota.serialization.Parsable
      Parameters:
      writer - Serialization writer to use to serialize this model
    • setAdditionalData

      public void setAdditionalData(@Nullable Map<String,Object> value)
      Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
      Parameters:
      value - Value to set for the AdditionalData property.
    • setAggregationFilters

      public void setAggregationFilters(@Nullable List<String> value)
      Sets the aggregationFilters property value. 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.
      Parameters:
      value - Value to set for the aggregationFilters property.
    • setAggregations

      public void setAggregations(@Nullable List<AggregationOption> value)
      Sets the aggregations property value. Specifies aggregations (also known as refiners) to be returned alongside search results. Optional.
      Parameters:
      value - Value to set for the aggregations property.
    • setBackingStore

      public void setBackingStore(@Nonnull com.microsoft.kiota.store.BackingStore value)
      Sets the backingStore property value. Stores model information.
      Parameters:
      value - Value to set for the backingStore property.
    • setCollapseProperties

      public void setCollapseProperties(@Nullable List<CollapseProperty> value)
      Sets the collapseProperties property value. Contains the ordered collection of fields and limit to collapse results. Optional.
      Parameters:
      value - Value to set for the collapseProperties property.
    • setContentSources

      public void setContentSources(@Nullable List<String> value)
      Sets the contentSources property value. Contains the connection to be targeted.
      Parameters:
      value - Value to set for the contentSources property.
    • setEnableTopResults

      public void setEnableTopResults(@Nullable Boolean value)
      Sets the enableTopResults property value. This triggers hybrid sort for messages : the first 3 messages are the most relevant. This property is only applicable to entityType=message. Optional.
      Parameters:
      value - Value to set for the enableTopResults property.
    • setEntityTypes

      public void setEntityTypes(@Nullable List<EntityType> value)
      Sets the entityTypes property value. 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. 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.
      Parameters:
      value - Value to set for the entityTypes property.
    • setFields

      public void setFields(@Nullable List<String> value)
      Sets the fields property value. 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.
      Parameters:
      value - Value to set for the fields property.
    • setFrom

      public void setFrom(@Nullable Integer value)
      Sets the from property value. Specifies the offset for the search results. Offset 0 returns the very first result. Optional.
      Parameters:
      value - Value to set for the from property.
    • setOdataType

      public void setOdataType(@Nullable String value)
      Sets the @odata.type property value. The OdataType property
      Parameters:
      value - Value to set for the @odata.type property.
    • setQuery

      public void setQuery(@Nullable SearchQuery value)
      Sets the query property value. The query property
      Parameters:
      value - Value to set for the query property.
    • setQueryAlterationOptions

      public void setQueryAlterationOptions(@Nullable SearchAlterationOptions value)
      Sets the queryAlterationOptions property value. Query alteration options formatted in a JSON blob that contains two optional flags related to spelling correction. Optional.
      Parameters:
      value - Value to set for the queryAlterationOptions property.
    • setRegion

      public void setRegion(@Nullable String value)
      Sets the region property value. The geographic location for the search. Required for searches that use application permissions. For details, see Get the region value.
      Parameters:
      value - Value to set for the region property.
    • setResultTemplateOptions

      public void setResultTemplateOptions(@Nullable ResultTemplateOption value)
      Sets the resultTemplateOptions property value. Provides the search result template options to render search results from connectors.
      Parameters:
      value - Value to set for the resultTemplateOptions property.
    • setSharePointOneDriveOptions

      public void setSharePointOneDriveOptions(@Nullable SharePointOneDriveOptions value)
      Sets the sharePointOneDriveOptions property value. Indicates the kind of contents to be searched when a search is performed using application permissions. Optional.
      Parameters:
      value - Value to set for the sharePointOneDriveOptions property.
    • setSize

      public void setSize(@Nullable Integer value)
      Sets the size property value. The size of the page to be retrieved. The maximum value is 500. Optional.
      Parameters:
      value - Value to set for the size property.
    • setSortProperties

      public void setSortProperties(@Nullable List<SortProperty> value)
      Sets the sortProperties property value. Contains the ordered collection of fields and direction to sort results. There can be at most 5 sort properties in the collection. Optional.
      Parameters:
      value - Value to set for the sortProperties property.