forked from DebaucheryLibrarian/traxxx
Updated search query function to include ranking.
This commit is contained in:
parent
85372581bd
commit
1b3bf01ed7
|
@ -95,7 +95,6 @@ export default {
|
||||||
background: var(--profile);
|
background: var(--profile);
|
||||||
font-size: 0;
|
font-size: 0;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
box-shadow: 0 0 3px var(--darken);
|
|
||||||
|
|
||||||
.favicon {
|
.favicon {
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
|
|
|
@ -34,11 +34,12 @@ function initUiActions(_store, _router) {
|
||||||
$query: String!
|
$query: String!
|
||||||
$limit: Int = 20
|
$limit: Int = 20
|
||||||
) {
|
) {
|
||||||
releases: searchReleases(
|
results: searchReleases(
|
||||||
query: $query
|
query: $query
|
||||||
first: $limit
|
first: $limit
|
||||||
minimumRank: "0.025"
|
minimumRank: "0.025"
|
||||||
) {
|
) {
|
||||||
|
release: releaseById {
|
||||||
id
|
id
|
||||||
title
|
title
|
||||||
slug
|
slug
|
||||||
|
@ -91,6 +92,8 @@ function initUiActions(_store, _router) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rank
|
||||||
|
}
|
||||||
actors: searchActors(
|
actors: searchActors(
|
||||||
search: $query,
|
search: $query,
|
||||||
first: $limit
|
first: $limit
|
||||||
|
@ -157,7 +160,7 @@ function initUiActions(_store, _router) {
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
releases: res.releases.map(release => curateRelease(release)),
|
releases: res.results.map(result => curateRelease(result.release)),
|
||||||
actors: res.actors.map(actor => curateActor(actor)),
|
actors: res.actors.map(actor => curateActor(actor)),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1020,8 +1020,13 @@ exports.up = knex => Promise.resolve()
|
||||||
);
|
);
|
||||||
$$ LANGUAGE SQL STABLE;
|
$$ LANGUAGE SQL STABLE;
|
||||||
|
|
||||||
CREATE FUNCTION search_releases(query text, minimum_rank numeric DEFAULT 0) RETURNS SETOF releases AS $$
|
/* We need both the release entries and their search ranking, and PostGraphile does not seem to allow virtual foreign keys on function results.
|
||||||
SELECT releases.* FROM (
|
* Using a view as a proxy for the search results allows us to get both a reference to the releases table, and the ranking */
|
||||||
|
CREATE VIEW releases_search_results AS
|
||||||
|
SELECT NULL::integer as id, NULL::real as rank;
|
||||||
|
|
||||||
|
CREATE FUNCTION search_releases(query text, minimum_rank numeric DEFAULT 0) RETURNS SETOF releases_search_results AS $$
|
||||||
|
SELECT releases.id, ranks.rank FROM (
|
||||||
SELECT
|
SELECT
|
||||||
releases_search.release_id,
|
releases_search.release_id,
|
||||||
ts_rank(releases_search.document, to_tsquery('english', regexp_replace(query, '[\\s._-]+', '|', 'gi'))) AS rank
|
ts_rank(releases_search.document, to_tsquery('english', regexp_replace(query, '[\\s._-]+', '|', 'gi'))) AS rank
|
||||||
|
@ -1196,6 +1201,8 @@ exports.up = knex => Promise.resolve()
|
||||||
COMMENT ON FUNCTION actors_scenes IS E'@sortable';
|
COMMENT ON FUNCTION actors_scenes IS E'@sortable';
|
||||||
|
|
||||||
COMMENT ON FUNCTION tags_scenes IS E'@sortable';
|
COMMENT ON FUNCTION tags_scenes IS E'@sortable';
|
||||||
|
|
||||||
|
COMMENT ON VIEW releases_search_results is E'@foreignKey (id) REFERENCES releases (id)';
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1257,6 +1264,8 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
||||||
DROP TABLE IF EXISTS entities_types CASCADE;
|
DROP TABLE IF EXISTS entities_types CASCADE;
|
||||||
DROP TABLE IF EXISTS entities CASCADE;
|
DROP TABLE IF EXISTS entities CASCADE;
|
||||||
|
|
||||||
|
DROP FUNCTION IF EXISTS search_releases_legacy;
|
||||||
|
DROP FUNCTION IF EXISTS search_releases;
|
||||||
DROP FUNCTION IF EXISTS search_sites;
|
DROP FUNCTION IF EXISTS search_sites;
|
||||||
DROP FUNCTION IF EXISTS search_entities;
|
DROP FUNCTION IF EXISTS search_entities;
|
||||||
DROP FUNCTION IF EXISTS search_actors;
|
DROP FUNCTION IF EXISTS search_actors;
|
||||||
|
@ -1272,6 +1281,8 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
||||||
DROP FUNCTION IF EXISTS movies_tags;
|
DROP FUNCTION IF EXISTS movies_tags;
|
||||||
DROP FUNCTION IF EXISTS movies_photos;
|
DROP FUNCTION IF EXISTS movies_photos;
|
||||||
|
|
||||||
|
DROP VIEW IF EXISTS releases_search_results;
|
||||||
|
|
||||||
DROP TEXT SEARCH CONFIGURATION IF EXISTS traxxx;
|
DROP TEXT SEARCH CONFIGURATION IF EXISTS traxxx;
|
||||||
DROP TEXT SEARCH DICTIONARY IF EXISTS traxxx_dict;
|
DROP TEXT SEARCH DICTIONARY IF EXISTS traxxx_dict;
|
||||||
`);
|
`);
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.0 MiB |
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.7 MiB |
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
|
@ -658,7 +658,7 @@ const tagPosters = [
|
||||||
['squirting', 0, 'Veronica Rodriguez in "Hot Latina Squirting" for Jules Jordan'],
|
['squirting', 0, 'Veronica Rodriguez in "Hot Latina Squirting" for Jules Jordan'],
|
||||||
['schoolgirl', 2, 'Cindy Shine in "Schoolgirl Stars in Interracial DP Threesome" for Private'],
|
['schoolgirl', 2, 'Cindy Shine in "Schoolgirl Stars in Interracial DP Threesome" for Private'],
|
||||||
['swallowing', 'poster'],
|
['swallowing', 'poster'],
|
||||||
['tattoos', 1, 'Joanna Angel for Joanna Angel'],
|
['tattoos', 0, 'Tigerlilly in "Wrapped In Blue" for Suicide Girls'],
|
||||||
['teen', 0, 'Alexa Flexy for Sensual Girl'],
|
['teen', 0, 'Alexa Flexy for Sensual Girl'],
|
||||||
['titty-fucking', 2, 'Layla London in "Touch Me" for Big Naturals'],
|
['titty-fucking', 2, 'Layla London in "Touch Me" for Big Naturals'],
|
||||||
['toys', 1, 'Chloe Lamour in "Curives In All The Right Places" for Wet and Puffy'],
|
['toys', 1, 'Chloe Lamour in "Curives In All The Right Places" for Wet and Puffy'],
|
||||||
|
@ -894,13 +894,14 @@ const tagPhotos = [
|
||||||
['redhead', 0, 'Penny Pax in "The Submission of Emma Marx: Boundaries" for New Sensations'],
|
['redhead', 0, 'Penny Pax in "The Submission of Emma Marx: Boundaries" for New Sensations'],
|
||||||
['schoolgirl', 1, 'Eliza Ibarra for Brazzers'],
|
['schoolgirl', 1, 'Eliza Ibarra for Brazzers'],
|
||||||
['squirting', 1, 'Abella Danger and Karma Rx in "Neon Dreaming" for Brazzers'],
|
['squirting', 1, 'Abella Danger and Karma Rx in "Neon Dreaming" for Brazzers'],
|
||||||
['tattoos', 0, 'Tigerlilly in "Wrapped In Blue" for Suicide Girls'],
|
['tattoos', 1, 'Joanna Angel for Joanna Angel'],
|
||||||
['teen', 1, 'Stalfra aka Precious for Nubiles'],
|
['teen', 1, 'Stalfra aka Precious for Nubiles'],
|
||||||
['trainbang', 1, 'Ria Sunn for Private'],
|
['trainbang', 1, 'Ria Sunn for Private'],
|
||||||
['trainbang', 0, 'Nicole Black in GIO971 for LegalPorno'],
|
['trainbang', 0, 'Nicole Black in GIO971 for LegalPorno'],
|
||||||
['tap', 1, 'Natasha Teen in SZ2098 for LegalPorno'],
|
['tap', 1, 'Natasha Teen in SZ2098 for LegalPorno'],
|
||||||
['tap', 2, 'Kira Thorn in GIO1018 for LegalPorno'],
|
['tap', 2, 'Kira Thorn in GIO1018 for LegalPorno'],
|
||||||
['titty-fucking', 0, 'Kylie Page in "Stepsis Gives Soapy Handjob In Shower" for Spy Fam'],
|
['titty-fucking', 0, 'Kylie Page in "Stepsis Gives Soapy Handjob In Shower" for Spy Fam'],
|
||||||
|
['titty-fucking', 3, 'Anna Bell Peaks in "Ringing Her Bell" for MilfVR'],
|
||||||
['titty-fucking', 1, 'Chloe Lamour for DDF Busty'],
|
['titty-fucking', 1, 'Chloe Lamour for DDF Busty'],
|
||||||
['toy-anal', 3, 'Kelly and Leona in "Sleeping Over" for Lez Cuties'],
|
['toy-anal', 3, 'Kelly and Leona in "Sleeping Over" for Lez Cuties'],
|
||||||
['toy-anal', 2, 'Denise, Irina and Laki in "Sexy Slumber" for Lez Cuties'],
|
['toy-anal', 2, 'Denise, Irina and Laki in "Sexy Slumber" for Lez Cuties'],
|
||||||
|
|
Loading…
Reference in New Issue