Fixed search documents to coalesce empty parent entities.

This commit is contained in:
ThePendulum 2020-06-30 01:52:17 +02:00
parent 08dc06c810
commit ff384fb734
7 changed files with 29 additions and 12 deletions

View File

@ -314,8 +314,8 @@ export default {
.logo-site {
height: 3rem;
width: 100%;
max-width: 15rem;
margin: .25rem 0;
object-fit: contain;
object-position: 100% 50%;
}
@ -470,7 +470,7 @@ export default {
display: inline-block;
}
.site {
.logo-site {
max-width: 100%;
}

View File

@ -85,6 +85,14 @@ export default {
.releases {
border-top: solid 1px var(--crease);
&.embedded {
border: none;
.tiles {
padding: 0;
}
}
}
.tiles {

View File

@ -30,6 +30,7 @@
<Releases
v-if="!loading && releases.length > 0"
class="embedded"
:releases="releases"
/>
</div>
@ -93,6 +94,10 @@ export default {
<style lang="scss" scoped>
@import 'theme';
.content-inner {
padding: 1rem;
}
.summary {
display: block;
margin: 0 0 1rem 0;

View File

@ -43,12 +43,12 @@ function initUiActions(_store, _router) {
url
type
isNew
site {
entity {
id
slug
name
url
network {
parent {
id
slug
name
@ -105,7 +105,7 @@ function initUiActions(_store, _router) {
dateOfBirth
dateOfDeath
gender
network {
entity {
id
name
slug
@ -124,7 +124,7 @@ function initUiActions(_store, _router) {
alias
}
}
network {
entity {
id
name
slug

View File

@ -2,4 +2,6 @@ SELECT tags.name FROM actors
LEFT JOIN releases_actors ON releases_actors.actor_id = actors.id
LEFT JOIN releases_tags ON releases_tags.release_id = releases_actors.release_id
LEFT JOIN tags ON tags.id = releases_tags.tag_id
WHERE actors.slug = 'vina-sky';
WHERE actors.slug = 'vina-sky'
GROUP BY tags.id
ORDER BY tags.name;

View File

@ -97,6 +97,9 @@ exports.up = knex => Promise.resolve()
table.integer('priority', 2)
.defaultTo(0);
table.boolean('filter')
.defaultTo(false);
table.boolean('secondary')
.defaultTo(false);

View File

@ -174,13 +174,12 @@ async function updateReleasesSearch(releaseIds) {
TO_TSVECTOR(
'traxxx',
COALESCE(releases.title, '') || ' ' ||
parents.name || ' ' ||
parents.slug || ' ' ||
parents.url || ' ' ||
entities.name || ' ' ||
entities.slug || ' ' ||
COALESCE(entities.url, '') || ' ' ||
COALESCE(entities.alias, '') || ' ' ||
COALESCE(parents.name, '') || ' ' ||
COALESCE(parents.slug, '') || ' ' ||
COALESCE(parents.alias, '') || ' ' ||
COALESCE(releases.shoot_id, '') || ' ' ||
COALESCE(TO_CHAR(releases.date, 'YYYY YY MM FMMM FMmonth mon DD FMDD'), '') || ' ' ||
STRING_AGG(COALESCE(actors.name, ''), ' ') || ' ' ||
@ -196,7 +195,7 @@ async function updateReleasesSearch(releaseIds) {
LEFT JOIN tags ON local_tags.tag_id = tags.id AND tags.priority >= 7
LEFT JOIN tags as tags_aliases ON local_tags.tag_id = tags_aliases.alias_for AND tags_aliases.secondary = true
${releaseIds ? 'WHERE releases.id = ANY(?)' : ''}
GROUP BY releases.id, entities.name, entities.slug, entities.alias, entities.url, parents.name, parents.slug, parents.url;
GROUP BY releases.id, entities.name, entities.slug, entities.alias, parents.name, parents.slug, parents.alias;
`, releaseIds && [releaseIds]);
if (documents.rows?.length > 0) {