Commit Graph

15 Commits

Author SHA1 Message Date
tanner 9e68a725d0 Make aka header matching stricter 2026-02-06 09:12:28 -07:00
tanner 44da87a29d feat: Extract 'aka' lines from first paragraph for H1 indexing
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
2026-02-06 09:06:34 -07:00
tanner 2ef3a1392f feat: Treat contextual colon-suffixed lines as headings for indexing
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
2026-02-05 15:36:39 -07:00
Simon Cambier 0a57b7bc6a #477 Use Text Extractor as a fallback to AI Image Analyzer 2025-09-03 16:49:13 +02:00
Simon Cambier d66aeeafef #467 - Higher tolerance for errors during indexing, show error when result is missing from search 2025-06-06 19:17:44 +02:00
Simon Cambier 3b60a8fe1b Errors counting 2025-05-25 12:35:24 +02:00
Eli W. Hunter 9d7f4183cf feat: Allow #heading as display title setting (#434)
* feat: Allow #heading as display name setting

* Add displayTitle usage to create markdown link

* Tweak description text

* Address comments
2025-01-29 09:45:14 +01:00
Simon Cambier ca3ca3b24b Small logging refactoring
Most logs are now console.debug
Removed "Omnisearch" prefix in (almost) all logs
Removed timestamp prefix
2024-11-09 17:46:48 +01:00
Bao 1c98d8b2d7 Fix uncaught exceptions (#414)
* Fix handling of folders on create trigger

When creating a directory in the vault, omnisearch attempts to index the directory as a document

`on('create', (file) => any, ...)` is triggered for both files and directories, so any triggers on `create` should handle the case where `file` is a `TFolder`.[^1]

[^1]: https://docs.obsidian.md/Reference/TypeScript+API/Vault/on('create')

For example, after running `mkdir foobar` in the vault directory, the
following exception is thrown:

```stacktrace
documents-repository.ts:53 Omnisearch: Error while adding "foobar" to live cache Error: Not a TFile: "foobar"
    at DocumentsRepository.getAndMapIndexedDocument (documents-repository.ts:85:41)
    at DocumentsRepository.addDocument (documents-repository.ts:43:30)
    at DocumentsRepository.getDocument (documents-repository.ts:69:16)
    at eval (search-engine.ts:82:63)
    at Array.map (<anonymous>)
    at SearchEngine.addFromPaths (search-engine.ts:81:15)
    at eval (main.ts:114:26)
    at e.tryTrigger (app.js:1:723011)
    at e.trigger (app.js:1:722944)
    at t.trigger (app.js:1:741049)
```

* Fix handling of empty canvas files

Canvas files can be empty. e.g. when the "Create new canvas" command is called:

- immediately after the command:
  - a new *empty* .canvas file will be created
  - triggering the `create` event and causing a "Unexpected end of JSON input" error
- when saving the file (<cmd/ctrl>+s or "Save current file" command):
  - `{}` will be written to the file
  - triggering a file `modify` event and causing a "canvas.nodes is not iterable" exception

Examples of the exceptions:

```stacktrace
documents-repository.ts:53 Omnisearch: Error while adding "Untitled.canvas" to live cache SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at DocumentsRepository.getAndMapIndexedDocument (documents-repository.ts:100:27)
    at async DocumentsRepository.addDocument (documents-repository.ts:43:19)
    at async DocumentsRepository.getDocument (documents-repository.ts:69:5)
    at async eval (search-engine.ts:82:25)
    at async Promise.all (index 0)
    at async SearchEngine.addFromPaths (search-engine.ts:80:7)
```

```stacktrace
documents-repository.ts:53 Omnisearch: Error while adding "Untitled.canvas" to live cache TypeError: canvas.nodes is not iterable
    at DocumentsRepository.getAndMapIndexedDocument (documents-repository.ts:103:33)
    at async DocumentsRepository.addDocument (documents-repository.ts:43:19)
    at async NotesIndexer.refreshIndex (notes-indexer.ts:29:7)
```
2024-11-05 18:40:58 +01:00
Simon Cambier efd99b67a0 small fixes 2024-10-26 11:07:21 +02:00
Simon Cambier 7d7902ec9d Warn when too many errors in a short time 2024-10-13 18:44:22 +02:00
Simon Cambier fc19f96dfd Renamed CacheManager to DocumentsRepository 2024-10-13 18:16:25 +02:00
Simon Cambier 983fa2120b fix(#245): correctly update embeds on fs events 2024-09-27 13:53:30 +02:00
Simon Cambier 10721601b1 ffs typescript. 2024-09-25 20:52:02 +02:00
Simon Cambier 1b442d1f24 feat(#245): in results list, show where an image/pdf is embedded
* Add an index of embeds for reference in results

* Notes embedding images are now shown in results

* Updated dependencies

* Correctly referencing all embeds

* Updated docs

* Basic embedded feature ok
2024-09-25 20:47:27 +02:00