Fetch page savedAt, readingProgress from elastic

This commit is contained in:
Hongbo Wu 2022-06-17 17:08:26 +08:00
parent 2bcf97d2e8
commit 26e7ab178e
2 changed files with 11 additions and 2 deletions

View file

@ -206,7 +206,15 @@ export const searchHighlights = async (
],
from,
size,
_source: ['title', 'slug', 'url', 'createdAt', 'highlights'],
_source: [
'title',
'slug',
'url',
'savedAt',
'highlights',
'readingProgressPercent',
'readingProgressAnchorIndex',
],
}
console.log('searching highlights in elastic', JSON.stringify(searchBody))

View file

@ -162,7 +162,7 @@ export interface Highlight {
suffix?: string | null
annotation?: string | null
sharedAt?: Date | null
updatedAt?: Date | null
updatedAt?: Date
labels?: Label[]
}
@ -226,6 +226,7 @@ export interface SearchItem {
language?: string
readAt?: Date
savedAt: Date
updatedAt?: Date
}
const keys = ['_id', 'url', 'slug', 'userId', 'uploadFileId', 'state'] as const