diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2025-06-13 12:55:34 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2025-06-13 12:55:34 -0400 |
| commit | e8de91eee099486200bac79406f17c149d1fcb5d (patch) | |
| tree | 4b163927f89ab6de662f4f7a50236aaa01e24978 /cmd/atlas.go | |
| parent | f85cfb2055551926ed4aeaa0550330d3e4da7569 (diff) | |
Add more flags to control document indexing
Added support for the following
* Ignore unpassable dates
* Ignore parsing non-standard header keys
* Ignore errors while parsing non-standard header keys
Diffstat (limited to 'cmd/atlas.go')
| -rw-r--r-- | cmd/atlas.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd/atlas.go b/cmd/atlas.go index f411a2b..3eabfbb 100644 --- a/cmd/atlas.go +++ b/cmd/atlas.go @@ -72,8 +72,8 @@ func main() { CustomFormat string }{} indexFlags := struct { - ignoreBadDates bool - Filters []index.DocFilter + Filters []index.DocFilter + index.ParseOpts }{} if len(args) < 1 { @@ -107,7 +107,9 @@ func main() { queryFs.Parse(args[1:]) case "index": - indexFs.BoolVar(&indexFlags.ignoreBadDates, "ignoreBadDates", false, "ignore malformed dates while indexing") + indexFs.BoolVar(&indexFlags.IgnoreDateError, "ignoreBadDates", false, "ignore malformed dates while indexing") + indexFs.BoolVar(&indexFlags.IgnoreMetaError, "ignoreMetaError", false, "ignore errors while parsing general YAML header info") + indexFs.BoolVar(&indexFlags.ParseMeta, "parseMeta", true, "parse YAML header values other title, authors, date, tags") customFilters := false indexFlags.Filters = index.DefaultFilters() @@ -198,7 +200,7 @@ func main() { filteredFiles := idx.Filter(traversedFiles, globalFlags.NumWorkers) fmt.Print(", Filtered ", len(filteredFiles)) - idx.Documents = index.ParseDocs(filteredFiles, globalFlags.NumWorkers, indexFlags.ignoreBadDates) + idx.Documents = index.ParseDocs(filteredFiles, globalFlags.NumWorkers, indexFlags.ParseOpts) fmt.Print(", Parsed ", len(idx.Documents), "\n") if err := querier.Put(idx); err != nil { |
