feat(search): gator fields in oo_docs_text + field filters (#86)
Release / GoReleaser (push) Skipped
Tests / Secret scan (gitleaks) (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Test (Go stable) (pull_request) Failing after 3s
Tests / Secret scan (gitleaks) (pull_request) Successful in 4s
Tests / Test (Go 1.25) (pull_request) Successful in 1m30s
Release / GoReleaser (push) Skipped
Tests / Secret scan (gitleaks) (push) Skipped
Tests / Test (Go 1.25) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Tests / Test (Go stable) (pull_request) Failing after 3s
Tests / Secret scan (gitleaks) (pull_request) Successful in 4s
Tests / Test (Go 1.25) (pull_request) Successful in 1m30s
- TextDoc carries gator keyword fields (doc_sha, number, seller, total, typ, issued_at, created_at, status, url); content is now omitempty so a partial doc can be written. - oo_docs_text mapping extended with the keyword fields. - ESTextIndex.UpsertFields: bulk update + doc_as_upsert, merging gator fields into an existing text doc without clobbering title/content. - SearchQuery gains Seller/Number/Status term filters; SearchHit.Fields exposes the gator values. Pure builders unit-tested.
This commit is contained in:
+9
-2
@@ -82,7 +82,8 @@ type FileStore interface {
|
||||
// SearchQuery narrows a Searcher request. InContent asks the backend to match
|
||||
// document bodies, not just titles. Substring switches title matching from the
|
||||
// analyzer's whole-token match to a case-insensitive "*term*" wildcard and ANDs
|
||||
// every whitespace-separated term (e.g. "rechnung 2025").
|
||||
// every whitespace-separated term (e.g. "rechnung 2025"). Seller/Number/Status
|
||||
// are exact filters over gator fields indexed into oo_docs_text (Option D).
|
||||
type SearchQuery struct {
|
||||
Text string
|
||||
InContent bool
|
||||
@@ -90,15 +91,21 @@ type SearchQuery struct {
|
||||
Extensions []string
|
||||
Limit int
|
||||
Substring bool
|
||||
Seller string
|
||||
Number string
|
||||
Status string
|
||||
}
|
||||
|
||||
// SearchHit is one Searcher result: the matching entry plus backend-specific
|
||||
// ranking metadata.
|
||||
// ranking metadata. Fields carries backend-specific extra key/values (for
|
||||
// oo_docs_text: gator document fields such as rechnungsnummer, lieferant,
|
||||
// betrag, status).
|
||||
type SearchHit struct {
|
||||
Entry
|
||||
Score float64
|
||||
Highlight string
|
||||
Path []string
|
||||
Fields map[string]string
|
||||
}
|
||||
|
||||
// Searcher is the optional content/name search surface. Only some backends
|
||||
|
||||
Reference in New Issue
Block a user