mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix parenthesized expression
This commit is contained in:
parent
284697da5b
commit
4ec16a1752
2 changed files with 4 additions and 1 deletions
|
|
@ -639,6 +639,7 @@ export const searchLibraryItems = async (
|
|||
): Promise<{ libraryItems: LibraryItem[]; count: number }> => {
|
||||
const { from = 0, size = 10 } = args
|
||||
|
||||
// select all columns except content
|
||||
const selects: Select[] = getColumns(libraryItemRepository)
|
||||
.map((column) => ({ column: `library_item.${column}` }))
|
||||
.filter(
|
||||
|
|
@ -653,6 +654,8 @@ export const searchLibraryItems = async (
|
|||
|
||||
if (args.query) {
|
||||
const searchQuery = parseSearchQuery(args.query)
|
||||
|
||||
// build query and save parameters
|
||||
query = buildQuery(
|
||||
searchQuery,
|
||||
parameters,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export const parseSearchQuery = (query: string): LiqeQuery => {
|
|||
.replace('in:subscription', 'has:subscriptions') // compatibility with old search
|
||||
.replace('in:library', 'no:subscription') // compatibility with old search
|
||||
// wrap the value behind colon in quotes if it's not already
|
||||
.replace(/(\w+):("([^"]+)"|([^"\s]+))/g, '$1:"$3$4"')
|
||||
.replace(/(\w+):("([^"]+)"|([^")\s]+))/g, '$1:"$3$4"')
|
||||
|
||||
return parse(searchQuery)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue