Skip to content

Commit

Permalink
VCST-1633: Search products do not return any results (#37)
Browse files Browse the repository at this point in the history
fix: Search products do not return any results if SearchFields contains _content_en_us or any custom localization
  • Loading branch information
OlegoO authored Aug 7, 2024
1 parent 5693a89 commit 9672d6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
23 changes: 1 addition & 22 deletions src/VirtoCommerce.ElasticAppSearch.Core/ModuleConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,27 +114,6 @@ public static class Permissions

public static class Settings
{
public const int DefaultTotalFieldsLimit = 1000;

public static class Indexing
{
public static SettingDescriptor IndexTotalFieldsLimit { get; } = new()
{
Name = "VirtoCommerce.Search.ElasticAppSearch.IndexTotalFieldsLimit",
GroupName = "Search|ElasticSearch",
ValueType = SettingValueType.Integer,
DefaultValue = DefaultTotalFieldsLimit,
};

public static IEnumerable<SettingDescriptor> AllIndexingSettings
{
get
{
yield return IndexTotalFieldsLimit;
}
}
}

public static IEnumerable<SettingDescriptor> AllSettings => Indexing.AllIndexingSettings;
public static IEnumerable<SettingDescriptor> AllSettings => [];
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -191,7 +190,7 @@ protected virtual ISort GetSortingField(SortingField field)

protected virtual Dictionary<string, SearchFieldValue> GetSearchFields(IEnumerable<string> searchFields)
{
searchFields = searchFields?.Where(x => !ModuleConstants.Api.FieldNames.IgnoredForSearch.Contains(x));
searchFields = searchFields?.Where(x => !ModuleConstants.Api.FieldNames.IgnoredForSearch.Any(ignoredField => x.StartsWith(ignoredField)));

var result = searchFields?.ToDictionary(searchField => _fieldNameConverter.ToProviderFieldName(searchField), _ => new SearchFieldValue());

Expand Down

0 comments on commit 9672d6e

Please sign in to comment.