Skip to content

Commit f961cd5

Browse files
committed
Improve Upstash Search indexing
1 parent 642946d commit f961cd5

12 files changed

Lines changed: 341 additions & 167 deletions

File tree

‎.github/workflows/search.yml‎

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ jobs:
4646
current_run_id: ${{ github.event.workflow_run.id }}
4747
head_sha: ${{ github.event.workflow_run.head_sha }}
4848

49-
- name: Setup Node.js
50-
if: steps.scope.outputs.should_index == 'true'
51-
uses: actions/setup-node@v6.3.0
52-
with:
53-
node-version: '24.x'
54-
5549
- name: Validate Upstash credentials
5650
if: steps.scope.outputs.should_index == 'true'
5751
run: |
@@ -64,14 +58,23 @@ jobs:
6458
exit 1
6559
fi
6660
67-
- name: Crawl /articles
68-
if: steps.scope.outputs.should_index == 'true' && steps.scope.outputs.crawl_articles == 'true'
69-
run: >-
70-
npx -y @upstash/search-crawler
71-
--upstash-url "${{ vars.UPSTASH_SEARCH_REST_URL }}"
72-
--upstash-token "${{ secrets.UPSTASH_SEARCH_REST_TOKEN }}"
73-
--index-name "default"
74-
--doc-url "https://www.webstackbuilders.com/articles"
61+
- name: Index changed collections
62+
if: steps.scope.outputs.should_index == 'true'
63+
env:
64+
UPSTASH_SEARCH_REST_URL: ${{ vars.UPSTASH_SEARCH_REST_URL }}
65+
UPSTASH_SEARCH_REST_TOKEN: ${{ secrets.UPSTASH_SEARCH_REST_TOKEN }}
66+
run: |
67+
COLLECTIONS=""
68+
if [ "${{ steps.scope.outputs.crawl_articles }}" = "true" ]; then
69+
COLLECTIONS="$COLLECTIONS --collection articles --collection deep-dive"
70+
fi
71+
if [ "${{ steps.scope.outputs.crawl_services }}" = "true" ]; then
72+
COLLECTIONS="$COLLECTIONS --collection services"
73+
fi
74+
if [ "${{ steps.scope.outputs.crawl_case_studies }}" = "true" ]; then
75+
COLLECTIONS="$COLLECTIONS --collection case-studies"
76+
fi
77+
python3 scripts/search-index.py --no-drop $COLLECTIONS
7578
7679
- name: Prune removed /articles
7780
if: steps.scope.outputs.should_index == 'true' && steps.scope.outputs.crawl_articles == 'true'
@@ -88,15 +91,6 @@ jobs:
8891
site_origin: https://www.webstackbuilders.com
8992
collection: articles
9093

91-
- name: Crawl /services
92-
if: steps.scope.outputs.should_index == 'true' && steps.scope.outputs.crawl_services == 'true'
93-
run: >-
94-
npx -y @upstash/search-crawler
95-
--upstash-url "${{ vars.UPSTASH_SEARCH_REST_URL }}"
96-
--upstash-token "${{ secrets.UPSTASH_SEARCH_REST_TOKEN }}"
97-
--index-name "default"
98-
--doc-url "https://www.webstackbuilders.com/services"
99-
10094
- name: Prune removed /services
10195
if: steps.scope.outputs.should_index == 'true' && steps.scope.outputs.crawl_services == 'true'
10296
uses: ./.github/actions/prune-upstash-search
@@ -112,15 +106,6 @@ jobs:
112106
site_origin: https://www.webstackbuilders.com
113107
collection: services
114108

115-
- name: Crawl /case-studies
116-
if: steps.scope.outputs.should_index == 'true' && steps.scope.outputs.crawl_case_studies == 'true'
117-
run: >-
118-
npx -y @upstash/search-crawler
119-
--upstash-url "${{ vars.UPSTASH_SEARCH_REST_URL }}"
120-
--upstash-token "${{ secrets.UPSTASH_SEARCH_REST_TOKEN }}"
121-
--index-name "default"
122-
--doc-url "https://www.webstackbuilders.com/case-studies"
123-
124109
- name: Prune removed /case-studies
125110
if: steps.scope.outputs.should_index == 'true' && steps.scope.outputs.crawl_case_studies == 'true'
126111
uses: ./.github/actions/prune-upstash-search

‎_TODO.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ Discuss agentic AI integrations to add to Backstage
3333

3434
Implement mitigations in test/e2e/specs/07-performance/PERFORMANCE.md
3535

36-
## Email Templates
37-
38-
Right now we're using string literals to define HTML email templates for site mails. We should use Nunjucks with the rule-checking for valid CSS in HTML emails like we have in the corporate email footer repo.
39-
4036
## Chat bot tying into my phone and email
4137

4238
Vercel AI Gateway, maybe could use for a chatbot:
@@ -160,18 +156,22 @@ Styling: You must use inline CSS within your `headerTemplate` or `footerTemplate
160156

161157
## ToolTips
162158

163-
Need a tooltip component for consistency. List to add tooltips to:
159+
Need a tooltip component for consistency.
160+
161+
List to add tooltips to:
164162

165163
- Themepicker button
166164
- Search button
165+
166+
These have tooltips, how are they being generated?
167+
167168
- Abbreviations in markdown
168169
- "Report a Bug" in footer
169170
- RSS feed icon in footer
170171

171172
## Support Pages to Style
172173

173-
- Bug reporter modal
174-
- Email templates
174+
- Bug reporter modal. Should have option to minimize and carry state if it's minimized after someone enters bug info in case they need to collect info from the site for the report.
175175

176176
## HubSpot Signup Issues
177177

‎requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ pytest-sugar==1.1.1
77
pytest-xdist==3.8.0
88
pytest==9.0.2
99
python-dotenv==1.2.2
10+
PyYAML==6.0.2
1011
requests==2.32.5
1112
upstash-search==0.1.1

0 commit comments

Comments
 (0)