Skip to content

Commit

Permalink
Remove unsupported characters from Azure Search section id (Azure-Sam…
Browse files Browse the repository at this point in the history
  • Loading branch information
anatolip authored Mar 22, 2023
1 parent ffc416c commit e201432
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/prepdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def find_page(offset):
def create_sections(filename, pages):
for i, (section, pagenum) in enumerate(split_text(pages)):
yield {
"id": f"{filename}-{i}".replace(".", "_").replace(" ", "_"),
"id": re.sub("[^0-9a-zA-Z_-]","_",f"{filename}-{i}"),
"content": section,
"category": args.category,
"sourcepage": blob_name_from_file_page(filename, pagenum),
Expand Down

0 comments on commit e201432

Please sign in to comment.