Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update selector attributes #11

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions scraper/src/strategies/algolia_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -74,7 +74,7 @@ def get(config, levels):
'attribute',
'exact',
'desc(weight.level)',
'desc(weight.position)'
'asc(weight.position)'
],
'highlightPreTag': '<span class="algolia-docsearch-suggestion--highlight">',
'highlightPostTag': '</span>',
Expand Down