Added scene tags filter.

This commit is contained in:
2024-01-08 02:21:57 +01:00
parent 5db4f18123
commit 7d5efd12ef
17 changed files with 1136 additions and 136 deletions

View File

@@ -66,7 +66,7 @@ export async function fetchActorsById(actorIds, options = {}) {
const actor = actors.find((actorEntry) => actorEntry.id === actorId);
if (!actor) {
console.warn(`Can't find ${actorId}`);
console.warn(`Can't match actor ${actorId}`);
return null;
}
@@ -103,6 +103,8 @@ function buildQuery(filters) {
};
if (filters.query) {
console.log(filters.query);
query.bool.must.push({
match: {
name: filters.query,
@@ -198,6 +200,7 @@ function buildQuery(filters) {
const sortMap = {
likes: 'stashed',
scenes: 'scenes',
relevance: '_score',
};
function getSort(order) {
@@ -229,7 +232,7 @@ export async function fetchActors(filters, rawOptions) {
expressions,
limit: options.limit,
offset: (options.page - 1) * options.limit,
sort: getSort(options.order),
sort: getSort(options.order, filters),
aggs: {
countries: {
terms: {