diff --git a/docs/usage/search-results/data-sources/microsoft-search.md b/docs/usage/search-results/data-sources/microsoft-search.md index af9c3af7..9428e44c 100644 --- a/docs/usage/search-results/data-sources/microsoft-search.md +++ b/docs/usage/search-results/data-sources/microsoft-search.md @@ -14,3 +14,5 @@ The _'Microsoft Search'_ data source retrieve items from the Microsoft search en | **Enable spelling modifications** | Flag to enable spelling modifications. If enabled, the user will get the search results for the corrected query in case of no results for the original query with typos. The response will also include the spelling modification information in the **queryAlterationResponse** property. |**false** | **Sort settings** | Configure the sort settings of the data source. Properties listed in the dropdown are all static properties marked as _'Sortable'_ in the [SharePoint search schema](https://docs.microsoft.com/sharepoint/technical-reference/). However, it does not list all possible _RefinableXXX_ or aliases fields. To use them, you must enter the value manually and press 'Enter' to validate. For a particular field, you can define if it should be used for initial sort (i.e. when the results are loaded for the first time) or be only available for users in the sort control (i.e. after the results are loaded). **The sort control does not consider default sort fields (i.e. select them by default) and you can only sort on a single field at a time according the fields you defined**. If no user sort fields are defined in the configuration, the sort control won't be displayed. | None. | **Enable result Types** | Display results according to the result types defined in the Microsoft Search admin center. **This option can only be used if `External Items` entity type is selected and the layout type is "Adaptive Cards** | None. +| **Show SharePoint Embedded (hidden) in search results** | By default content in SharePoint Embedded Containers is not [visible](https://learn.microsoft.com/en-us/sharepoint/dev/embedded/concepts/content-experiences/search-content) in Microsoft Search. Add the relevant ContainerTypeids to the query template, like ContainerTypeId:"1adc34ca-aef3-4e13-aacf-39b43affd198" and the contain is now returned. | None. +| **Show MS Archived content in search results** | By default contain archived with Microsoft Archive is hidden from Microsoft Search, but this option sets the required "includeHiddenContent" and "isArchived" properties, which ensures that the contant is now returned by the API. | None. \ No newline at end of file diff --git a/search-parts/src/dataSources/MicrosoftSearchDataSource.ts b/search-parts/src/dataSources/MicrosoftSearchDataSource.ts index 1301f514..b2832a6c 100644 --- a/search-parts/src/dataSources/MicrosoftSearchDataSource.ts +++ b/search-parts/src/dataSources/MicrosoftSearchDataSource.ts @@ -101,6 +101,17 @@ export interface IMicrosoftSearchDataSourceProperties { * More information: https://learn.microsoft.com/en-us/graph/search-concept-collapse */ collapseProperties: ICollapseProperty[]; + /** + * Specifies if the search results should include the SharePoint embedded data. + * More information: https://learn.microsoft.com/en-us/sharepoint/dev/embedded/concepts/content-experiences/search-content + */ + showSPEmbeddedContent: boolean; + + /** + * Specifies if the search results should include the Microsoft Search archived content. + * More information: https://learn.microsoft.com/en-us/graph/api/resources/sharepointonedriveoptions?view=graph-rest-beta + */ + showMSArchivedContent: boolean; } export class MicrosoftSearchDataSource extends BaseDataSource { @@ -294,6 +305,7 @@ export class MicrosoftSearchDataSource extends BaseDataSource e).join(",") }), + new PropertyPaneAsyncCombo('dataSourceProperties.fields', { availableOptions: this._availableFields, allowMultiSelect: true, @@ -312,6 +324,16 @@ export class MicrosoftSearchDataSource extends BaseDataSource[] = [ @@ -374,6 +396,10 @@ export class MicrosoftSearchDataSource extends BaseDataSource { @@ -684,6 +712,10 @@ export class MicrosoftSearchDataSource extends BaseDataSource 0) { - if (dataContext.filters.filterOperator === 'and') { - // Make sure, if we have multiple filters, at least two filters have values to avoid apply an operator ('or','and') on only one condition failing the query. - const refinementStrings = DataFilterHelper.buildFqlRefinementString(dataContext.filters.selectedFilters, this.moment); - if (!isEmpty(refinementStrings)) { - aggregationFilters = aggregationFilters.concat(refinementStrings); + + // Make sure, if we have multiple filters, at least two filters have values to avoid apply an operator ('or','and') on only one condition failing the query. + if (dataContext.filters.selectedFilters.length > 1 && dataContext.filters.selectedFilters.filter(selectedFilter => selectedFilter.values.length > 0).length > 1) { + const refinementString = DataFilterHelper.buildFqlRefinementString(dataContext.filters.selectedFilters, dataContext.filters.filtersConfiguration, this.moment).join(','); + if (!isEmpty(refinementString)) { + aggregationFilters = aggregationFilters.concat([`${dataContext.filters.filterOperator}(${refinementString})`]); } + } else { - const refinementStrings = DataFilterHelper.buildKqlRefinementString(dataContext.filters.selectedFilters, this.moment); - if (!isEmpty(refinementStrings)) { - queryTemplate = refinementStrings ? `${queryTemplate} AND ${refinementStrings}` : queryTemplate; - } + aggregationFilters = aggregationFilters.concat(DataFilterHelper.buildFqlRefinementString(dataContext.filters.selectedFilters, dataContext.filters.filtersConfiguration, this.moment)); } } @@ -800,7 +831,23 @@ export class MicrosoftSearchDataSource extends BaseDataSourcebeta", TrimDuplicates: "Limpar duplicados", + showSPEmbeddedContentLabel: "Mostrar SharePoint incorporado (oculto) nos resultados de pesquisa", + showMSArchivedContentLabel: "Mostrar conteúdo arquivado do MS nos resultados da pesquisa", CollapseProperties: { EditCollapsePropertiesLabel: "Editar configurações de recolhimento", CollapsePropertiesDescription: "Especifique as configurações de recolhimento para os resultados da pesquisa. Você pode selecionar um campo na lista suspensa (somente se os dados da fonte de dados já tiverem sido buscados) ou digitar seu próprio valor personalizado (pressione 'Enter' para salvar sua entrada)", diff --git a/search-parts/src/loc/sv-SE.js b/search-parts/src/loc/sv-SE.js index 808d5ccf..c11aa330 100644 --- a/search-parts/src/loc/sv-SE.js +++ b/search-parts/src/loc/sv-SE.js @@ -150,6 +150,8 @@ define([], function () { ApplyQueryTemplateBtnText: "Tillämpa", UseBetaEndpoint: "Använd beta endpoint", TrimDuplicates: "Trimma dubbletter", + showSPEmbeddedContentLabel: "Visa SharePoint Embedded (dold) i sökresultat", + showMSArchivedContentLabel: "Visa MS-arkiverat innehåll i sökresultat", CollapseProperties: { EditCollapsePropertiesLabel: "Redigera komprimeringsinställningar", CollapsePropertiesDescription: "Ange komprimeringsinställningarna för sökresultaten. Du kan antingen välja ett fält från rullgardinsmenyn (endast om datakällans data redan har hämtats) eller ange ditt eget anpassade värde (tryck på 'Enter' för att spara din post)", diff --git a/search-parts/src/models/search/IMicrosoftSearchRequest.ts b/search-parts/src/models/search/IMicrosoftSearchRequest.ts index 96caa327..68926680 100644 --- a/search-parts/src/models/search/IMicrosoftSearchRequest.ts +++ b/search-parts/src/models/search/IMicrosoftSearchRequest.ts @@ -27,6 +27,9 @@ export interface IMicrosoftSearchRequest { }; trimDuplicates?: boolean; collapseProperties?: ICollapseProperty[]; + sharePointOneDriveOptions:{ + includeHiddenContent: boolean; + }; } export interface ISearchSortProperty {