diff --git a/scraper/src/strategies/algolia_settings.py b/scraper/src/strategies/algolia_settings.py index eb083666..342f7e1c 100644 --- a/scraper/src/strategies/algolia_settings.py +++ b/scraper/src/strategies/algolia_settings.py @@ -10,13 +10,13 @@ def get(config, levels): # We first look for matches in the exact titles for level in levels: - for selectors_key in config.selectors: - attr_to_index = 'unordered(hierarchy_radio.' + level + ')' - if level in config.selectors[ - selectors_key] and attr_to_index not in attributes_to_index: - attributes_to_index.append( - 'unordered(hierarchy_radio_camel.' + level + ')') - attributes_to_index.append(attr_to_index) + for selectors_key in config.selectors: + attr_to_index = 'unordered(hierarchy_radio.' + level + ')' + if level in config.selectors[ + selectors_key] and attr_to_index not in attributes_to_index: + attributes_to_index.append( + 'unordered(hierarchy_radio_camel.' + level + ')') + attributes_to_index.append(attr_to_index) # Then in the whole title hierarchy for level in levels: @@ -27,7 +27,7 @@ def get(config, levels): attributes_to_index.append( 'unordered(hierarchy_camel.' + level + ')') attributes_to_index.append(attr_to_index) - + for selectors_key in config.selectors: if 'content' in config.selectors[ selectors_key] and 'content' not in attributes_to_index: @@ -74,7 +74,7 @@ def get(config, levels): 'attribute', 'exact', 'desc(weight.level)', - 'desc(weight.position)' + 'asc(weight.position)' ], 'highlightPreTag': '', 'highlightPostTag': '',