Package com.microsoft.graph.models
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 Summary
FieldsModifier and TypeFieldDescriptionprotected com.microsoft.kiota.store.BackingStoreStores model information. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SearchRequestcreateFromDiscriminatorValue(com.microsoft.kiota.serialization.ParseNode parseNode) Creates a new instance of the appropriate class based on discriminator valueGets the AdditionalData property value.Gets the aggregationFilters property value.Gets the aggregations property value.com.microsoft.kiota.store.BackingStoreGets the backingStore property value.Gets the collapseProperties property value.Gets the contentSources property value.Gets the enableTopResults property value.Gets the entityTypes property value.The deserialization information for the current modelGets the fields property value.getFrom()Gets the from property value.Gets the @odata.type property value.getQuery()Gets the query property value.Gets the queryAlterationOptions property value.Gets the region property value.Gets the resultTemplateOptions property value.Gets the sharePointOneDriveOptions property value.getSize()Gets the size property value.Gets the sortProperties property value.voidserialize(com.microsoft.kiota.serialization.SerializationWriter writer) Serializes information the current objectvoidsetAdditionalData(Map<String, Object> value) Sets the AdditionalData property value.voidsetAggregationFilters(List<String> value) Sets the aggregationFilters property value.voidsetAggregations(List<AggregationOption> value) Sets the aggregations property value.voidsetBackingStore(com.microsoft.kiota.store.BackingStore value) Sets the backingStore property value.voidSets the collapseProperties property value.voidsetContentSources(List<String> value) Sets the contentSources property value.voidsetEnableTopResults(Boolean value) Sets the enableTopResults property value.voidsetEntityTypes(List<EntityType> value) Sets the entityTypes property value.voidSets the fields property value.voidSets the from property value.voidsetOdataType(String value) Sets the @odata.type property value.voidsetQuery(SearchQuery value) Sets the query property value.voidSets the queryAlterationOptions property value.voidSets the region property value.voidSets the resultTemplateOptions property value.voidSets the sharePointOneDriveOptions property value.voidSets the size property value.voidsetSortProperties(List<SortProperty> value) Sets the sortProperties property value.
-
Field Details
-
backingStore
@Nonnull protected com.microsoft.kiota.store.BackingStore backingStoreStores model information.
-
-
Constructor Details
-
SearchRequest
public SearchRequest()Instantiates a newSearchRequestand 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
Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -
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. -
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:
getBackingStorein interfacecom.microsoft.kiota.store.BackedModel- Returns:
- a
BackingStore
-
getCollapseProperties
Gets the collapseProperties property value. Contains the ordered collection of fields and limit to collapse results. Optional.- Returns:
- a
List<CollapseProperty>
-
getContentSources
Gets the contentSources property value. Contains the connection to be targeted. -
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
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 -
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 365 Copilot 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. -
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
Gets the @odata.type property value. The OdataType property- Returns:
- a
String
-
getQuery
Gets the query property value. The query property- Returns:
- a
SearchQuery
-
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
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
Gets the resultTemplateOptions property value. Provides the search result template options to render search results from connectors.- Returns:
- a
ResultTemplateOption
-
getSize
Gets the size property value. The size of the page to be retrieved. The maximum value is 500. Optional.- Returns:
- a
Integer
-
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:
serializein interfacecom.microsoft.kiota.serialization.Parsable- Parameters:
writer- Serialization writer to use to serialize this model
-
setAdditionalData
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
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
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
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
Sets the contentSources property value. Contains the connection to be targeted.- Parameters:
value- Value to set for the contentSources property.
-
setEnableTopResults
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
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
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 365 Copilot 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
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
Sets the @odata.type property value. The OdataType property- Parameters:
value- Value to set for the @odata.type property.
-
setQuery
Sets the query property value. The query property- Parameters:
value- Value to set for the query property.
-
setQueryAlterationOptions
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
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
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.
-
setSize
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
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.
-