Skip to content

Commit

Permalink
fix(specs): move customRanking and keepDiacriticsOnCharacters to inde…
Browse files Browse the repository at this point in the history
…xSettings [skip-bc] (generated)

algolia/api-clients-automation#4324

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
  • Loading branch information
algolia-bot and millotp committed Jan 9, 2025
1 parent d7b2a1b commit 785dda1
Show file tree
Hide file tree
Showing 50 changed files with 279 additions and 342 deletions.
18 changes: 16 additions & 2 deletions packages/algoliasearch/lib/src/model/base_index_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ final class BaseIndexSettings {
this.customNormalization,
this.attributeForDistinct,
this.maxFacetHits,
this.keepDiacriticsOnCharacters,
this.customRanking,
});

/// Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/). Facets are attributes that let you categorize search results. They can be used for filtering search results. By default, no attribute is used for faceting. Attribute names are case-sensitive. **Modifiers** - `filterOnly(\"ATTRIBUTE\")`. Allows the attribute to be used as a filter but doesn't evaluate the facet values. - `searchable(\"ATTRIBUTE\")`. Allows searching for facet values. - `afterDistinct(\"ATTRIBUTE\")`. Evaluates the facet count _after_ deduplication with `distinct`. This ensures accurate facet counts. You can apply this modifier to searchable facets: `afterDistinct(searchable(ATTRIBUTE))`.
Expand Down Expand Up @@ -104,6 +106,14 @@ final class BaseIndexSettings {
@JsonKey(name: r'maxFacetHits')
final int? maxFacetHits;

/// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
@JsonKey(name: r'keepDiacriticsOnCharacters')
final String? keepDiacriticsOnCharacters;

/// Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
@JsonKey(name: r'customRanking')
final List<String>? customRanking;

@override
bool operator ==(Object other) =>
identical(this, other) ||
Expand All @@ -127,7 +137,9 @@ final class BaseIndexSettings {
other.userData == userData &&
other.customNormalization == customNormalization &&
other.attributeForDistinct == attributeForDistinct &&
other.maxFacetHits == maxFacetHits;
other.maxFacetHits == maxFacetHits &&
other.keepDiacriticsOnCharacters == keepDiacriticsOnCharacters &&
other.customRanking == customRanking;

@override
int get hashCode =>
Expand All @@ -148,7 +160,9 @@ final class BaseIndexSettings {
userData.hashCode +
customNormalization.hashCode +
attributeForDistinct.hashCode +
maxFacetHits.hashCode;
maxFacetHits.hashCode +
keepDiacriticsOnCharacters.hashCode +
customRanking.hashCode;

factory BaseIndexSettings.fromJson(Map<String, dynamic> json) =>
_$BaseIndexSettingsFromJson(json);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions packages/algoliasearch/lib/src/model/browse_params_object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ final class BrowseParamsObject {
this.enableABTest,
this.attributesToRetrieve,
this.ranking,
this.customRanking,
this.relevancyStrictness,
this.attributesToHighlight,
this.attributesToSnippet,
Expand All @@ -68,7 +67,6 @@ final class BrowseParamsObject {
this.disableTypoToleranceOnAttributes,
this.ignorePlurals,
this.removeStopWords,
this.keepDiacriticsOnCharacters,
this.queryLanguages,
this.decompoundQuery,
this.enableRules,
Expand Down Expand Up @@ -256,10 +254,6 @@ final class BrowseParamsObject {
@JsonKey(name: r'ranking')
final List<String>? ranking;

/// Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
@JsonKey(name: r'customRanking')
final List<String>? customRanking;

/// Relevancy threshold below which less relevant results aren't included in the results. You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
@JsonKey(name: r'relevancyStrictness')
final int? relevancyStrictness;
Expand Down Expand Up @@ -329,10 +323,6 @@ final class BrowseParamsObject {
@JsonKey(name: r'removeStopWords')
final dynamic removeStopWords;

/// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
@JsonKey(name: r'keepDiacriticsOnCharacters')
final String? keepDiacriticsOnCharacters;

/// Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
@JsonKey(name: r'queryLanguages')
final List<SupportedLanguage>? queryLanguages;
Expand Down Expand Up @@ -475,7 +465,6 @@ final class BrowseParamsObject {
other.enableABTest == enableABTest &&
other.attributesToRetrieve == attributesToRetrieve &&
other.ranking == ranking &&
other.customRanking == customRanking &&
other.relevancyStrictness == relevancyStrictness &&
other.attributesToHighlight == attributesToHighlight &&
other.attributesToSnippet == attributesToSnippet &&
Expand All @@ -493,7 +482,6 @@ final class BrowseParamsObject {
disableTypoToleranceOnAttributes &&
other.ignorePlurals == ignorePlurals &&
other.removeStopWords == removeStopWords &&
other.keepDiacriticsOnCharacters == keepDiacriticsOnCharacters &&
other.queryLanguages == queryLanguages &&
other.decompoundQuery == decompoundQuery &&
other.enableRules == enableRules &&
Expand Down Expand Up @@ -557,7 +545,6 @@ final class BrowseParamsObject {
enableABTest.hashCode +
attributesToRetrieve.hashCode +
ranking.hashCode +
customRanking.hashCode +
relevancyStrictness.hashCode +
attributesToHighlight.hashCode +
attributesToSnippet.hashCode +
Expand All @@ -573,7 +560,6 @@ final class BrowseParamsObject {
disableTypoToleranceOnAttributes.hashCode +
ignorePlurals.hashCode +
removeStopWords.hashCode +
keepDiacriticsOnCharacters.hashCode +
queryLanguages.hashCode +
decompoundQuery.hashCode +
enableRules.hashCode +
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions packages/algoliasearch/lib/src/model/consequence_params.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ final class ConsequenceParams {
this.enableABTest,
this.attributesToRetrieve,
this.ranking,
this.customRanking,
this.relevancyStrictness,
this.attributesToHighlight,
this.attributesToSnippet,
Expand All @@ -67,7 +66,6 @@ final class ConsequenceParams {
this.disableTypoToleranceOnAttributes,
this.ignorePlurals,
this.removeStopWords,
this.keepDiacriticsOnCharacters,
this.queryLanguages,
this.decompoundQuery,
this.enableRules,
Expand Down Expand Up @@ -253,10 +251,6 @@ final class ConsequenceParams {
@JsonKey(name: r'ranking')
final List<String>? ranking;

/// Attributes to use as [custom ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Attribute names are case-sensitive. The custom ranking attributes decide which items are shown first if the other ranking criteria are equal. Records with missing values for your selected custom ranking attributes are always sorted last. Boolean attributes are sorted based on their alphabetical order. **Modifiers** - `asc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in ascending order. - `desc(\"ATTRIBUTE\")`. Sort the index by the values of an attribute, in descending order. If you use two or more custom ranking attributes, [reduce the precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) of your first attributes, or the other attributes will never be applied.
@JsonKey(name: r'customRanking')
final List<String>? customRanking;

/// Relevancy threshold below which less relevant results aren't included in the results. You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
@JsonKey(name: r'relevancyStrictness')
final int? relevancyStrictness;
Expand Down Expand Up @@ -326,10 +320,6 @@ final class ConsequenceParams {
@JsonKey(name: r'removeStopWords')
final dynamic removeStopWords;

/// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep their diacritics.
@JsonKey(name: r'keepDiacriticsOnCharacters')
final String? keepDiacriticsOnCharacters;

/// Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
@JsonKey(name: r'queryLanguages')
final List<SupportedLanguage>? queryLanguages;
Expand Down Expand Up @@ -485,7 +475,6 @@ final class ConsequenceParams {
other.enableABTest == enableABTest &&
other.attributesToRetrieve == attributesToRetrieve &&
other.ranking == ranking &&
other.customRanking == customRanking &&
other.relevancyStrictness == relevancyStrictness &&
other.attributesToHighlight == attributesToHighlight &&
other.attributesToSnippet == attributesToSnippet &&
Expand All @@ -503,7 +492,6 @@ final class ConsequenceParams {
disableTypoToleranceOnAttributes &&
other.ignorePlurals == ignorePlurals &&
other.removeStopWords == removeStopWords &&
other.keepDiacriticsOnCharacters == keepDiacriticsOnCharacters &&
other.queryLanguages == queryLanguages &&
other.decompoundQuery == decompoundQuery &&
other.enableRules == enableRules &&
Expand Down Expand Up @@ -568,7 +556,6 @@ final class ConsequenceParams {
enableABTest.hashCode +
attributesToRetrieve.hashCode +
ranking.hashCode +
customRanking.hashCode +
relevancyStrictness.hashCode +
attributesToHighlight.hashCode +
attributesToSnippet.hashCode +
Expand All @@ -584,7 +571,6 @@ final class ConsequenceParams {
disableTypoToleranceOnAttributes.hashCode +
ignorePlurals.hashCode +
removeStopWords.hashCode +
keepDiacriticsOnCharacters.hashCode +
queryLanguages.hashCode +
decompoundQuery.hashCode +
enableRules.hashCode +
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 785dda1

Please sign in to comment.