Skip to content

Commit 39fc931

Browse files
author
Daniel Bruce
committed
Changes made to search:
- removes Applicability facet - removes Publication Date, Effective Date from left list of facets. - tweaks UI theme for search results - hides dates that are N/A
1 parent bca336b commit 39fc931

File tree

2 files changed

+12
-44
lines changed

2 files changed

+12
-44
lines changed

spider/assets/js/search.js

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,19 @@ search.addWidget(
2929
var hitTemplate = `
3030
<div class="media">
3131
<div class="media-body">
32-
<h5>
32+
<h5 class="mb-0">
3333
{{__hitIndex}}.
3434
<a href="files/{{file_name}}#{{id}}">
3535
{{document_title}} - {{title}}
3636
</a>
3737
</h5>
3838
<ol class="document-dates">
39+
{{#pubdate}}
3940
<li>Published: {{pubdate}}</li>
41+
{{/pubdate}}
42+
{{#effdate}}
4043
<li>Effective: {{effdate}}</li>
44+
{{/effdate}}
4145
</ol>
4246
</div>
4347
</div>
@@ -60,6 +64,12 @@ search.addWidget(
6064
transformData: {
6165
item: function(item) {
6266
item.__hitIndex++;
67+
if (item.pubdate === 'N/A') {
68+
item.pubdate = null;
69+
}
70+
if (item.effdate === 'N/A') {
71+
item.effdate = null;
72+
}
6373
return item;
6474
},
6575
},
@@ -140,16 +150,6 @@ search.addWidget(
140150
})
141151
);
142152

143-
search.addWidget(
144-
instantsearch.widgets.refinementList({
145-
container: '#applicability',
146-
attributeName: 'applicability',
147-
limit: 5,
148-
showMore: true,
149-
cssClasses: refinementClasses,
150-
})
151-
);
152-
153153
search.addWidget(
154154
instantsearch.widgets.refinementList({
155155
container: '#compliance_user',
@@ -170,24 +170,4 @@ search.addWidget(
170170
})
171171
);
172172

173-
search.addWidget(
174-
instantsearch.widgets.refinementList({
175-
container: '#pubdate',
176-
attributeName: 'pubdate',
177-
limit: 5,
178-
showMore: true,
179-
cssClasses: refinementClasses,
180-
})
181-
);
182-
183-
search.addWidget(
184-
instantsearch.widgets.refinementList({
185-
container: '#effdate',
186-
attributeName: 'effdate',
187-
limit: 5,
188-
showMore: true,
189-
cssClasses: refinementClasses,
190-
})
191-
);
192-
193173
search.start();

spider/search.html

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ <h4>Source Type</h4>
152152
<h4>Topics</h4>
153153
<div id="topics"></div>
154154
</div>
155-
<div>
156-
<h4>Applicability</h4>
157-
<div id="applicability"></div>
158-
</div>
159155
<div>
160156
<h4>Compliance User</h4>
161157
<div id="compliance_user"></div>
@@ -164,14 +160,6 @@ <h4>Compliance User</h4>
164160
<h4>Content Type</h4>
165161
<div id="content_type"></div>
166162
</div>
167-
<div>
168-
<h4>Publication Date</h4>
169-
<div id="pubdate"></div>
170-
</div>
171-
<div>
172-
<h4>Effective Date</h4>
173-
<div id="effdate"></div>
174-
</div>
175163
</div>
176164
</div>
177165
</div>
@@ -185,7 +173,7 @@ <h4 class="mb-0">Search Results<small id="stats" class="ml-2"></small></h4>
185173
<div class="card-body">
186174
<div id="hits"></div>
187175
<div id="pagination" class="mt-2"></div>
188-
<div class="d-flex justify-content-end"><button class="btn btn-primary" type="button">Save Search</button></div>
176+
<div class="d-flex justify-content-between"><img src="assets/img/algolia-powered-by.svg"><button class="btn btn-primary" type="button">Save Search</button></div>
189177
</div>
190178
</div>
191179
</div>

0 commit comments

Comments
 (0)