mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-16 11:36:39 +01:00
lots of changes for the new unified search
This commit is contained in:
parent
630cd814e2
commit
b6ff88645b
29 changed files with 302 additions and 543 deletions
|
|
@ -22,6 +22,9 @@ export const FILTER_ASN_ISNULL = 18
|
|||
|
||||
export const FILTER_TITLE_CONTENT = 19
|
||||
|
||||
export const FILTER_FULLTEXT_QUERY = 20
|
||||
export const FILTER_FULLTEXT_MORELIKE = 21
|
||||
|
||||
export const FILTER_RULE_TYPES: FilterRuleType[] = [
|
||||
|
||||
{id: FILTER_TITLE, filtervar: "title__icontains", datatype: "string", multi: false, default: ""},
|
||||
|
|
@ -51,7 +54,11 @@ export const FILTER_RULE_TYPES: FilterRuleType[] = [
|
|||
{id: FILTER_MODIFIED_AFTER, filtervar: "modified__date__gt", datatype: "date", multi: false},
|
||||
{id: FILTER_ASN_ISNULL, filtervar: "archive_serial_number__isnull", datatype: "boolean", multi: false},
|
||||
|
||||
{id: FILTER_TITLE_CONTENT, filtervar: "title_content", datatype: "string", multi: false}
|
||||
{id: FILTER_TITLE_CONTENT, filtervar: "title_content", datatype: "string", multi: false},
|
||||
|
||||
{id: FILTER_FULLTEXT_QUERY, filtervar: "query", datatype: "string", multi: false},
|
||||
|
||||
{id: FILTER_FULLTEXT_MORELIKE, filtervar: "more_like_id", datatype: "number", multi: false},
|
||||
]
|
||||
|
||||
export interface FilterRuleType {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,15 @@ import { PaperlessTag } from './paperless-tag'
|
|||
import { PaperlessDocumentType } from './paperless-document-type'
|
||||
import { Observable } from 'rxjs'
|
||||
|
||||
export interface SearchHit {
|
||||
|
||||
score?: number
|
||||
rank?: number
|
||||
|
||||
highlights?: string
|
||||
|
||||
}
|
||||
|
||||
export interface PaperlessDocument extends ObjectWithId {
|
||||
|
||||
correspondent$?: Observable<PaperlessCorrespondent>
|
||||
|
|
@ -40,4 +49,6 @@ export interface PaperlessDocument extends ObjectWithId {
|
|||
|
||||
archive_serial_number?: number
|
||||
|
||||
__search_hit__?: SearchHit
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
import { PaperlessDocument } from './paperless-document'
|
||||
|
||||
export class SearchHitHighlight {
|
||||
text?: string
|
||||
term?: number
|
||||
}
|
||||
|
||||
export interface SearchHit {
|
||||
id?: number
|
||||
title?: string
|
||||
score?: number
|
||||
rank?: number
|
||||
|
||||
highlights?: SearchHitHighlight[][]
|
||||
document?: PaperlessDocument
|
||||
}
|
||||
|
||||
export interface SearchResult {
|
||||
|
||||
count?: number
|
||||
page?: number
|
||||
page_count?: number
|
||||
|
||||
corrected_query?: string
|
||||
|
||||
results?: SearchHit[]
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue