Fixes #15136: Search includes fields from other cultures (#15148)

* Fixes #15136: Search includes fields from other cultures

Regex was updated to support block list fields
Unpublished nodes on the supplied culture are not filtered out

* Making the code non-breaking

* Fixed failing publish content query integration tests

The tests were not setting the content as publish in the specifed culture
causing the content items to be ignored

---------

Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
This commit is contained in:
Vitor Rodrigues
2024-02-07 13:43:37 +01:00
committed by GitHub
parent 2221c4f1c7
commit 839b2ff6a2
5 changed files with 62 additions and 52 deletions

View File

@@ -131,4 +131,21 @@ public interface IPublishedContentQuery
/// The search results.
/// </returns>
IEnumerable<PublishedSearchResult> Search(IQueryExecutor query, int skip, int take, out long totalRecords);
/// <summary>
/// Executes the query and converts the results to <see cref="PublishedSearchResult" />.
/// </summary>
/// <param name="query">The query.</param>
/// <param name="skip">The amount of results to skip.</param>
/// <param name="take">The amount of results to take/return.</param>
/// <param name="totalRecords">The total amount of records.</param>
/// <param name="culture">The culture (defaults to a culture insensitive search).</param>
/// <returns>
/// The search results.
/// </returns>
/// <remarks>
/// While enumerating results, the ambient culture is changed to be the searched culture.
/// </remarks>
IEnumerable<PublishedSearchResult> Search(IQueryExecutor query, int skip, int take, out long totalRecords, string? culture)
=> Search(query, skip, take, out totalRecords);
}