mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
lots of changes for the new unified search
This commit is contained in:
@@ -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[]
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user