diff --git a/src/client/components/facet_results/ReactVirtualizedTable.js b/src/client/components/facet_results/ReactVirtualizedTable.js index 1591ff7cb149eb7a3985173ed590dadaeb209dfe..0f5f77e9a23dc8f39adcb62347bd49603a8008cb 100644 --- a/src/client/components/facet_results/ReactVirtualizedTable.js +++ b/src/client/components/facet_results/ReactVirtualizedTable.js @@ -68,7 +68,7 @@ class MuiVirtualizedTable extends React.PureComponent { cellRenderer = ({ cellData, columnIndex }) => { const { columns /* classes, rowHeight, onRowClick */ } = this.props - const { id, valueType, makeLink, externalLink, sortValues, numberedList, minWidth } = columns[columnIndex] + const { id, valueType, makeLink, externalLink, sortValues, numberedList, minWidth, collapsedMaxWords } = columns[columnIndex] return ( <ResultTableCell columnId={id} @@ -80,7 +80,8 @@ class MuiVirtualizedTable extends React.PureComponent { sortValues={sortValues} minWidth={minWidth} container='div' - expanded + expanded={false} + collapsedMaxWords={collapsedMaxWords} /> ) }; @@ -189,7 +190,7 @@ const rootStyle = { } const tableContainer = { - width: 700, + width: 1100, height: '100%', marginLeft: 'auto', marginRight: 'auto' diff --git a/src/client/reducers/sampo/fullTextSearch.js b/src/client/reducers/sampo/fullTextSearch.js index e45cad1864f5878eba44af95a1a539dc2619dc63..d94e5af1317382735172566353b1a47ded3edbc0 100644 --- a/src/client/reducers/sampo/fullTextSearch.js +++ b/src/client/reducers/sampo/fullTextSearch.js @@ -23,12 +23,22 @@ export const INITIAL_STATE = { }, { id: 'type', - valueType: 'string', + valueType: 'object', makeLink: false, externalLink: false, sortValues: false, numberedList: false, minWidth: 300 + }, + { + id: 'note', + valueType: 'string', + makeLink: false, + externalLink: false, + sortValues: false, + numberedList: false, + minWidth: 400, + collapsedMaxWords: 4 } ], fetching: false @@ -62,13 +72,15 @@ const fullTextSearch = (state = INITIAL_STATE, action) => { sortBy = action.sortBy sortDirection = 'asc' } + const sortByProperty = state.properties.find(property => property.id === sortBy) + const sortByPath = sortByProperty.valueType === 'object' ? `${sortBy}.prefLabel` : sortBy return { ...state, sortBy, sortDirection, results: orderBy( state.results, - sortBy === 'prefLabel' ? 'prefLabel.prefLabel' : sortBy, + sortByPath, sortDirection ) } diff --git a/src/client/translations/sampo/localeEN.js b/src/client/translations/sampo/localeEN.js index 81cb159d374a8b5c665474498f1a5a1427655d38..020799eeb348768428aa5c5d9b5c9c1026a2e0dc 100644 --- a/src/client/translations/sampo/localeEN.js +++ b/src/client/translations/sampo/localeEN.js @@ -677,10 +677,14 @@ export default { label: 'Type', description: '' }, - source: { - label: 'Source', + note: { + label: 'Note', description: '' } + // source: { + // label: 'Source', + // description: '' + // } } }, manuscripts: { diff --git a/src/server/sparql/JenaQuery.js b/src/server/sparql/JenaQuery.js index 116d0398f26c77cd0d0ebd5da80e0bdc8a62a1e7..7fd6866e66edee923d66d6ef17eb2af47bdd31aa 100644 --- a/src/server/sparql/JenaQuery.js +++ b/src/server/sparql/JenaQuery.js @@ -18,7 +18,7 @@ export const queryJenaIndex = async ({ endpoint = backendSearchConfig[config.perspectiveID].endpoint } const { properties } = config - q = q.replace('<QUERY>', `?id text:query ('${queryTerm.toLowerCase()}' 2000) .`) + q = q.replace('<QUERY>', `(?id ?score) text:query ('${queryTerm.toLowerCase()}' 2000) .`) q = q.replace('<RESULT_SET_PROPERTIES>', properties) const results = await runSelectQuery({ query: endpoint.prefixes + q, diff --git a/src/server/sparql/SparqlQueriesGeneral.js b/src/server/sparql/SparqlQueriesGeneral.js index a1566dbabb99291afb3ada32b36b5c82e53a7495..4a8d20fd6f2a026e3f24bfd655792684819956fa 100644 --- a/src/server/sparql/SparqlQueriesGeneral.js +++ b/src/server/sparql/SparqlQueriesGeneral.js @@ -24,13 +24,11 @@ export const jenaQuery = ` ` export const fullTextQuery = ` - SELECT ?id ?prefLabel__id ?prefLabel__prefLabel ?prefLabel__dataProviderUrl - (SAMPLE(?type_) as ?type) + SELECT * WHERE { <QUERY> <RESULT_SET_PROPERTIES> } - GROUP BY ?id ?prefLabel__id ?prefLabel__prefLabel ?prefLabel__dataProviderUrl ` export const facetResultSetQuery = ` diff --git a/src/server/sparql/sampo/sparql_queries/SparqlQueriesFullText.js b/src/server/sparql/sampo/sparql_queries/SparqlQueriesFullText.js index 04e2513bc1f538d9809a926bfff118155951ca16..741e0d607eaaec0a329fc5bc45a61db466c5f358 100644 --- a/src/server/sparql/sampo/sparql_queries/SparqlQueriesFullText.js +++ b/src/server/sparql/sampo/sparql_queries/SparqlQueriesFullText.js @@ -1,6 +1,6 @@ export const fullTextSearchProperties = ` { - VALUES ?type_uri { + VALUES ?type__id { frbroo:F4_Manifestation_Singleton frbroo:F1_Work frbroo:F2_Expression @@ -16,8 +16,12 @@ export const fullTextSearchProperties = ` crm:E53_Place crm:E78_Collection } - ?id a ?type_uri . - ?type_uri skos:prefLabel|rdfs:label ?type_ . + ?id a ?type__id . + ?type__id skos:prefLabel|rdfs:label ?type__prefLabel . + } + UNION + { + ?id crm:P3_has_note ?note . # crm:P3_has_note has been added to text index } UNION {