1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-10-30 23:57:43 +02:00

renaming "from" and "to" to "after" and "before" in search query #309

This commit is contained in:
Patrik J. Braun
2021-05-23 17:58:58 +02:00
parent d0153e58d9
commit f84f555182
3 changed files with 29 additions and 23 deletions

View File

@@ -138,26 +138,28 @@ export class BenchmarkRunner {
await this.setupDB(); await this.setupDB();
const queryKeywords: QueryKeywords = { const queryKeywords: QueryKeywords = {
NSomeOf: '-of', NSomeOf: 'of',
and: 'and', and: 'and',
caption: 'caption', or: 'or',
directory: 'directory',
file_name: 'file-name', from: 'after',
from: 'from', to: 'before',
keyword: 'keyword',
landscape: 'landscape', landscape: 'landscape',
maxRating: 'max-rating', maxRating: 'max-rating',
maxResolution: 'max-resolution', maxResolution: 'max-resolution',
minRating: 'min-rating', minRating: 'min-rating',
minResolution: 'min-resolution', minResolution: 'min-resolution',
or: 'or',
orientation: 'orientation', orientation: 'orientation',
any_text: 'any-text', any_text: 'any-text',
keyword: 'keyword',
caption: 'caption',
directory: 'directory',
file_name: 'file-name',
person: 'person', person: 'person',
portrait: 'portrait', portrait: 'portrait',
position: 'position', position: 'position',
someOf: 'some-of', someOf: 'some-of',
to: 'to',
kmFrom: 'km-from' kmFrom: 'km-from'
}; };
const queryParser = new SearchQueryParser(queryKeywords); const queryParser = new SearchQueryParser(queryKeywords);

View File

@@ -8,24 +8,26 @@ export class SearchQueryParserService {
public readonly keywords: QueryKeywords = { public readonly keywords: QueryKeywords = {
NSomeOf: 'of', NSomeOf: 'of',
and: 'and', and: 'and',
caption: 'caption', or: 'or',
directory: 'directory',
file_name: 'file-name', from: 'after',
from: 'from', to: 'before',
keyword: 'keyword',
landscape: 'landscape', landscape: 'landscape',
maxRating: 'max-rating', maxRating: 'max-rating',
maxResolution: 'max-resolution', maxResolution: 'max-resolution',
minRating: 'min-rating', minRating: 'min-rating',
minResolution: 'min-resolution', minResolution: 'min-resolution',
or: 'or',
orientation: 'orientation', orientation: 'orientation',
any_text: 'any-text', any_text: 'any-text',
keyword: 'keyword',
caption: 'caption',
directory: 'directory',
file_name: 'file-name',
person: 'person', person: 'person',
portrait: 'portrait', portrait: 'portrait',
position: 'position', position: 'position',
someOf: 'some-of', someOf: 'some-of',
to: 'to',
kmFrom: 'km-from' kmFrom: 'km-from'
}; };
private readonly parser: SearchQueryParser; private readonly parser: SearchQueryParser;

View File

@@ -20,26 +20,28 @@ import {
import {QueryKeywords, SearchQueryParser} from '../../../src/common/SearchQueryParser'; import {QueryKeywords, SearchQueryParser} from '../../../src/common/SearchQueryParser';
const queryKeywords: QueryKeywords = { const queryKeywords: QueryKeywords = {
NSomeOf: '-of', NSomeOf: 'of',
and: 'and', and: 'and',
caption: 'caption', or: 'or',
directory: 'directory',
file_name: 'file-name', from: 'after',
from: 'from', to: 'before',
keyword: 'keyword',
landscape: 'landscape', landscape: 'landscape',
maxRating: 'max-rating', maxRating: 'max-rating',
maxResolution: 'max-resolution', maxResolution: 'max-resolution',
minRating: 'min-rating', minRating: 'min-rating',
minResolution: 'min-resolution', minResolution: 'min-resolution',
or: 'or',
orientation: 'orientation', orientation: 'orientation',
any_text: 'any-text', any_text: 'any-text',
keyword: 'keyword',
caption: 'caption',
directory: 'directory',
file_name: 'file-name',
person: 'person', person: 'person',
portrait: 'portrait', portrait: 'portrait',
position: 'position', position: 'position',
someOf: 'some-of', someOf: 'some-of',
to: 'to',
kmFrom: 'km-from' kmFrom: 'km-from'
}; };