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: {
Search,
},
data() {
return {
query: this.$route.query ? this.$route.query.q : null,
};
},
};
</script>

View File

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

View File

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

View File

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