Skip to content

Commit f24ade2

Browse files
committed
Update index structure
1 parent 8a70b20 commit f24ade2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

_elastic/indexer.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ def build_documents(version, build_folder):
2626
soup = BeautifulSoup(html, 'html.parser')
2727
h1_elements = [a.get_text() for a in soup.find_all("h1")]
2828
h2_elements = [a.get_text() for a in soup.find_all("h2")]
29+
h3_elements = [a.get_text() for a in soup.find_all("h3")]
2930

3031
element = {"version": version, "title": title, "parent_title": parent_title,
31-
"slug": slug, "html": html, "h1": h1_elements, "h2": h2_elements}
32+
"slug": slug, "html": html, "h1": h1_elements, "h2": h2_elements,
33+
"h3": h3_elements}
3234
yield element
3335

3436

@@ -79,7 +81,10 @@ def create_index(self):
7981
"title" : { "type" : "text" },
8082
"parent_title" : { "type" : "text" },
8183
"version": {"type": "text"},
82-
"url" : { "type" : "text" }
84+
"url" : { "type" : "text" },
85+
"h1" : { "type" : "text" },
86+
"h2" : { "type" : "text" },
87+
"h3" : { "type" : "text" }
8388
}
8489
}
8590
}

0 commit comments

Comments
 (0)