Skip to content

Commit 813f18b

Browse files
UILD-825: Update query building for LoC Children's Authorities source (#421)
* Update query building for LoC Children's Authorities source; update search results styling * Update query building for LoC Children's Authorities source; update search results styling #2 --------- Co-authored-by: PBobylev <pavel_bobylev@epam.com>
1 parent 6e27b92 commit 813f18b

9 files changed

Lines changed: 103 additions & 30 deletions

File tree

src/common/constants/searchableIndex.constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export enum SearchableIndex {
1616
Title = 'title',
1717
Contributor = 'contributor',
1818
// LD Authority / combined authority SearchBy options
19-
Concept = 'concept',
2019
Family = 'family',
2120
Form = 'form',
2221
Jurisdiction = 'jurisdiction',
@@ -26,6 +25,7 @@ export enum SearchableIndex {
2625
Place = 'place',
2726
Temporal = 'temporal',
2827
Topic = 'topic',
28+
ComplexSubject = 'complexSubject',
2929
}
3030

3131
export enum SearchableIndexQuerySelector {

src/features/search/core/config/authoritiesLocChildren.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SearchableIndex as SearchableIndexEnum } from '@/common/constants/searchableIndex.constants';
22

3-
import { COMPLEX_LOOKUP_SEARCHABLE_INDICES_MAP } from '../constants';
3+
import { AUTHORITIES_LOC_CHILDREN_SEARCHABLE_INDICES_MAP } from '../constants/authoritiesLocChildren.constants';
44
import { AuthoritiesSearchRequestBuilder } from '../strategies/requestBuilders';
55
import { AuthoritiesSearchResponseTransformer } from '../strategies/responseTransformers';
66
import { AuthoritiesSourceEnricher } from '../strategies/resultEnrichers';
@@ -11,7 +11,7 @@ export const authoritiesLocChildrenConfig: SearchTypeConfig = {
1111
id: 'authorities:locChildren',
1212

1313
strategies: {
14-
requestBuilder: new AuthoritiesSearchRequestBuilder(COMPLEX_LOOKUP_SEARCHABLE_INDICES_MAP),
14+
requestBuilder: new AuthoritiesSearchRequestBuilder(AUTHORITIES_LOC_CHILDREN_SEARCHABLE_INDICES_MAP),
1515
responseTransformer: new AuthoritiesSearchResponseTransformer(),
1616
resultFormatter: new MarcAuthoritiesPageResultFormatter(),
1717
resultEnricher: new AuthoritiesSourceEnricher(),

src/features/search/core/constants/authoritiesIndices.constants.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ export const COMPLEX_LOOKUP_SEARCHABLE_INDICES_MAP: SearchableIndicesMap = {
5555
[SearchableIndex.Form]: {
5656
[SearchableIndexQuerySelector.Query]: `(genreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}")`,
5757
},
58-
[SearchableIndex.Concept]: {
59-
[SearchableIndexQuerySelector.Query]: `(keyword all "${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}")`,
58+
[SearchableIndex.ComplexSubject]: {
59+
[SearchableIndexQuerySelector.Query]: `(complexSubjectTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftComplexSubjectTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftComplexSubjectTerm all "${SEARCH_QUERY_VALUE_PARAM}")`,
6060
},
6161
[SearchableIndex.Topic]: {
6262
[SearchableIndexQuerySelector.Query]: `(topicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}")`,
6363
},
6464
[SearchableIndex.Temporal]: {
65-
[SearchableIndexQuerySelector.Query]: `(keyword all "${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}")`,
65+
[SearchableIndexQuerySelector.Query]: `(temporalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftTemporalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftTemporalTerm all "${SEARCH_QUERY_VALUE_PARAM}")`,
6666
},
6767
[SearchableIndex.Jurisdiction]: {
68-
[SearchableIndexQuerySelector.Query]: `(geographicName all "${SEARCH_QUERY_VALUE_PARAM}" or sftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}" or saftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}")`,
68+
[SearchableIndexQuerySelector.Query]: `(corporateName all "${SEARCH_QUERY_VALUE_PARAM}" or sftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}" or saftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}")`,
6969
},
7070
},
7171
[SearchSegment.Browse]: {
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { SEARCH_QUERY_VALUE_PARAM, SearchSegment } from '@/common/constants/search.constants';
2+
import { SearchableIndex, SearchableIndexQuerySelector } from '@/common/constants/searchableIndex.constants';
3+
4+
export const AUTHORITIES_LOC_CHILDREN_SEARCHABLE_INDICES_MAP: SearchableIndicesMap = {
5+
[SearchSegment.Search]: {
6+
[SearchableIndex.Keyword]: {
7+
[SearchableIndexQuerySelector.Query]: `((keyword=="${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
8+
},
9+
[SearchableIndex.Identifier]: {
10+
[SearchableIndexQuerySelector.Query]: `(((identifiers.value=="${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}") and authRefType=="Authorized") and subjectHeadings=="b")`,
11+
},
12+
[SearchableIndex.LCCN]: {
13+
[SearchableIndexQuerySelector.Query]: `(lccn=="${SEARCH_QUERY_VALUE_PARAM}" and subjectHeadings=="b")`,
14+
},
15+
[SearchableIndex.PersonalName]: {
16+
[SearchableIndexQuerySelector.Query]: `((personalName all "${SEARCH_QUERY_VALUE_PARAM}" or sftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}" or saftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
17+
},
18+
[SearchableIndex.CorporateConferenceName]: {
19+
[SearchableIndexQuerySelector.Query]: `((corporateName all "${SEARCH_QUERY_VALUE_PARAM}" or sftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}" or saftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}" or meetingName all "${SEARCH_QUERY_VALUE_PARAM}" or sftMeetingName all "${SEARCH_QUERY_VALUE_PARAM}" or saftMeetingName all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
20+
},
21+
[SearchableIndex.GeographicName]: {
22+
[SearchableIndexQuerySelector.Query]: `((geographicName all "${SEARCH_QUERY_VALUE_PARAM}" or sftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}" or saftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
23+
},
24+
[SearchableIndex.NameTitle]: {
25+
[SearchableIndexQuerySelector.Query]: `((personalNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftPersonalNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftPersonalNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or corporateNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftCorporateNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftCorporateNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or meetingNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftMeetingNameTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftMeetingNameTitle all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
26+
},
27+
[SearchableIndex.UniformTitle]: {
28+
[SearchableIndexQuerySelector.Query]: `((uniformTitle all "${SEARCH_QUERY_VALUE_PARAM}" or sftUniformTitle all "${SEARCH_QUERY_VALUE_PARAM}" or saftUniformTitle all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
29+
},
30+
[SearchableIndex.Subject]: {
31+
[SearchableIndexQuerySelector.Query]: `((topicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
32+
},
33+
[SearchableIndex.ChildrenSubjectHeading]: {
34+
[SearchableIndexQuerySelector.Query]: `((keyword all "${SEARCH_QUERY_VALUE_PARAM}" or naturalId="${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
35+
},
36+
[SearchableIndex.Genre]: {
37+
[SearchableIndexQuerySelector.Query]: `((genreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b"`,
38+
},
39+
// Combined authority page options
40+
[SearchableIndex.Person]: {
41+
[SearchableIndexQuerySelector.Query]: `((personalName all "${SEARCH_QUERY_VALUE_PARAM}" or sftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}" or saftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
42+
},
43+
[SearchableIndex.Family]: {
44+
[SearchableIndexQuerySelector.Query]: `((personalName all "${SEARCH_QUERY_VALUE_PARAM}" or sftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}" or saftPersonalName all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
45+
},
46+
[SearchableIndex.Organization]: {
47+
[SearchableIndexQuerySelector.Query]: `((corporateName all "${SEARCH_QUERY_VALUE_PARAM}" or sftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}" or saftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
48+
},
49+
[SearchableIndex.Meeting]: {
50+
[SearchableIndexQuerySelector.Query]: `((meetingName all "${SEARCH_QUERY_VALUE_PARAM}" or sftMeetingName all "${SEARCH_QUERY_VALUE_PARAM}" or saftMeetingName all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
51+
},
52+
[SearchableIndex.Place]: {
53+
[SearchableIndexQuerySelector.Query]: `((geographicName all "${SEARCH_QUERY_VALUE_PARAM}" or sftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}" or saftGeographicName all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
54+
},
55+
[SearchableIndex.Form]: {
56+
[SearchableIndexQuerySelector.Query]: `((genreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftGenreTerm all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
57+
},
58+
[SearchableIndex.ComplexSubject]: {
59+
[SearchableIndexQuerySelector.Query]: `((complexSubjectTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftComplexSubjectTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftComplexSubjectTerm all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
60+
},
61+
[SearchableIndex.Topic]: {
62+
[SearchableIndexQuerySelector.Query]: `((topicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftTopicalTerm all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
63+
},
64+
[SearchableIndex.Temporal]: {
65+
[SearchableIndexQuerySelector.Query]: `((temporalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or sftTemporalTerm all "${SEARCH_QUERY_VALUE_PARAM}" or saftTemporalTerm all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
66+
},
67+
[SearchableIndex.Jurisdiction]: {
68+
[SearchableIndexQuerySelector.Query]: `((corporateName all "${SEARCH_QUERY_VALUE_PARAM}" or sftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}" or saftCorporateName all "${SEARCH_QUERY_VALUE_PARAM}") and subjectHeadings=="b")`,
69+
},
70+
},
71+
// TODO: change the type to get rid of this old "Search" and "Browse" structure.
72+
[SearchSegment.Browse]: {},
73+
};

src/features/search/core/constants/ldAuthoritiesIndices.constants.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,21 @@ const typeLabelEntry = (type: string) => ({
1515
export const LD_AUTHORITIES_SEARCHABLE_INDICES_MAP: SearchableIndicesMap = {
1616
[SearchSegment.Search]: {
1717
[SearchableIndex.Keyword]: typeLabelEntry('keyword'),
18-
// Identifier intentionally uses the same lccn query as LCCN
1918
[SearchableIndex.Identifier]: {
20-
[SearchableIndexQuerySelector.Query]: `(lccn all "${SEARCH_QUERY_VALUE_PARAM}")`,
19+
[SearchableIndexQuerySelector.Query]: `(identifier all "${SEARCH_QUERY_VALUE_PARAM}")`,
2120
},
22-
[SearchableIndex.LCCN]: {
23-
[SearchableIndexQuerySelector.Query]: `(lccn all "${SEARCH_QUERY_VALUE_PARAM}")`,
24-
},
25-
[SearchableIndex.Concept]: typeLabelEntry('concept'),
2621
[SearchableIndex.Family]: typeLabelEntry('family'),
2722
[SearchableIndex.Form]: typeLabelEntry('form'),
2823
[SearchableIndex.Jurisdiction]: typeLabelEntry('jurisdiction'),
2924
[SearchableIndex.Meeting]: typeLabelEntry('meeting'),
3025
[SearchableIndex.Organization]: typeLabelEntry('organization'),
3126
[SearchableIndex.Person]: typeLabelEntry('person'),
3227
[SearchableIndex.Place]: typeLabelEntry('place'),
33-
[SearchableIndex.Subject]: typeLabelEntry('subject'),
3428
[SearchableIndex.Temporal]: typeLabelEntry('temporal'),
3529
[SearchableIndex.Topic]: typeLabelEntry('topic'),
30+
[SearchableIndex.ComplexSubject]: typeLabelEntry('complexSubject'),
31+
[SearchableIndex.UniformTitle]: typeLabelEntry('uniformTitle'),
32+
[SearchableIndex.NameTitle]: typeLabelEntry('nameTitle'),
3633
},
3734
[SearchSegment.Browse]: {},
3835
};

src/features/search/ui/config/authoritiesUI.config.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ export const authoritiesUIConfig: SearchTypeUIConfig = {
3535
labelId: 'ld.identifierAll',
3636
value: SearchableIndex.Identifier,
3737
},
38-
{
39-
labelId: 'ld.lccn',
40-
value: SearchableIndex.LCCN,
41-
},
42-
{
43-
labelId: 'ld.concept',
44-
value: SearchableIndex.Concept,
45-
},
4638
{
4739
labelId: 'ld.family',
4840
value: SearchableIndex.Family,
@@ -71,14 +63,6 @@ export const authoritiesUIConfig: SearchTypeUIConfig = {
7163
labelId: 'ld.place',
7264
value: SearchableIndex.Place,
7365
},
74-
{
75-
labelId: 'ld.subject',
76-
value: SearchableIndex.Subject,
77-
},
78-
{
79-
labelId: 'ld.childrensSubjectHeading',
80-
value: SearchableIndex.ChildrenSubjectHeading,
81-
},
8266
{
8367
labelId: 'ld.temporal',
8468
value: SearchableIndex.Temporal,
@@ -87,6 +71,10 @@ export const authoritiesUIConfig: SearchTypeUIConfig = {
8771
labelId: 'ld.topic',
8872
value: SearchableIndex.Topic,
8973
},
74+
{
75+
labelId: 'ld.complexSubject',
76+
value: SearchableIndex.ComplexSubject,
77+
},
9078
{
9179
labelId: 'ld.uniformTitle',
9280
value: SearchableIndex.UniformTitle,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// TODO: create a common style for search results.
2+
.authority-link {
3+
font-weight: 400;
4+
}
5+
6+
button.authority-link {
7+
text-align: left;
8+
9+
&:hover {
10+
text-decoration-line: underline;
11+
}
12+
}

src/features/search/ui/formatters/authorities/AuthorityLabelFormatter.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { FC } from 'react';
22

33
import { Button, ButtonType } from '@/components/Button';
44

5+
import './AuthorityLabelFormatter.scss';
6+
57
interface AuthorityLabelFormatterProps {
68
row: SearchResultsTableRow;
79
onTitleClick?: (id: string) => void;

translations/ui-linked-data/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
"ld.nameTitle": "Name-title",
180180
"ld.uniformTitle": "Uniform title",
181181
"ld.subject": "Subject",
182+
"ld.complexSubject": "Complex subject",
182183
"ld.searchSubjectAuthority": "Search subject authority",
183184
"ld.childrensSubjectHeading": "Children's subject heading",
184185
"ld.genre": "Genre",

0 commit comments

Comments
 (0)