Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
remove algolia setting for index
Browse files Browse the repository at this point in the history
  • Loading branch information
angelinekwan committed Aug 1, 2023
1 parent 46a69f8 commit a2435d5
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions scripts/index_algolia.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@
# Path relative to build dir
INDEX_BLACKLIST = ["search.html", "genindex.html"]

def create_index(client, index_name):
# Initialize your index
index = client.init_index(index_name)

# Configure the settings for your index
settings = {
'searchableAttributes': ['title', 'body'],
'attributesForFaceting': ['facetingType'],
'customRanking': ['desc(popularity)']
}
index.set_settings(settings)

def parse_pages(html_build_dir):
pages = []

Expand Down Expand Up @@ -101,7 +89,9 @@ def index_pages(client, index_name, pages):
if __name__ == '__main__':
args = parser.parse_args()

# Connect and authenticate with your Algolia app
client = SearchClient.create(args.algolia_app_id, args.algolia_api_key)
create_index(client, args.algolia_index_name)

# Create a new index and add a record
pages = parse_pages(args.html_build_dir)
index_pages(client, args.algolia_index_name, pages)

0 comments on commit a2435d5

Please sign in to comment.