Improved search query prep. Showing query in header after refresh.

This commit is contained in:
ThePendulum 2020-02-29 23:57:45 +01:00
parent 44394ae85d
commit a8e14f6305
4 changed files with 4 additions and 8 deletions

View File

@ -84,11 +84,6 @@ export default {
components: { components: {
Search, Search,
}, },
data() {
return {
query: this.$route.query ? this.$route.query.q : null,
};
},
}; };
</script> </script>

View File

@ -26,7 +26,7 @@ async function search() {
export default { export default {
data() { data() {
return { return {
query: null, query: this.$route.query ? this.$route.query.q : null,
}; };
}, },
methods: { methods: {

View File

@ -496,8 +496,8 @@ exports.up = knex => Promise.resolve()
CREATE FUNCTION search_releases(query text) RETURNS SETOF releases_search AS $$ CREATE FUNCTION search_releases(query text) RETURNS SETOF releases_search AS $$
SELECT * FROM releases_search AS search SELECT * FROM releases_search AS search
WHERE search.document @@ plainto_tsquery('traxxx', regexp_replace(query, '\\.|-', ' ', 'g')) WHERE search.document @@ plainto_tsquery('traxxx', regexp_replace(query, '\\.|-|(XXX\\.[\\d+|hd|sd].*$)', ' ', 'ig'))
ORDER BY ts_rank(search.document, plainto_tsquery('traxxx', regexp_replace(query, '\\.|-', ' ', 'g'))) DESC; ORDER BY ts_rank(search.document, plainto_tsquery('traxxx', regexp_replace(query, '\\.|-|(XXX\\.[\\d+|hd|sd].*$)', ' ', 'ig'))) DESC;
$$ LANGUAGE SQL STABLE; $$ LANGUAGE SQL STABLE;
CREATE FUNCTION search_sites(search text) RETURNS SETOF sites AS $$ CREATE FUNCTION search_sites(search text) RETURNS SETOF sites AS $$

View File

@ -141,6 +141,7 @@ ktr
mkv mkv
mov mov
mp4 mp4
rarbg
rartv rartv
robots robots
scenes scenes