Problem
When searching multiple terms separately, the same note can appear more than once. Example: a note named 📅 #timeline / Kia Cerato Koup matches both Kia and Cerato, so naive search can return duplicates.
Desired behavior
Search results should be deduplicated by Apple Notes id.
Example:
scripts/commands/search.sh Kia Cerato
Should return the Kia Cerato Koup note once, with both terms listed:
📅 #timeline / Kia Cerato Koup ... MATCHED_TERMS=Kia,Cerato
Implementation notes
- Keep a
seenIds list in AppleScript, or deduplicate in shell after collecting results.
- Prefer deduping by the stable
id, not note name, because duplicate note titles are possible.
- Preserve all matched terms for the note.
Acceptance criteria
- A note matching 2+ search terms appears once.
- Duplicate note titles with different IDs still appear as separate results.
- Tests or documented manual verification cover the multi-term duplicate case.
Problem
When searching multiple terms separately, the same note can appear more than once. Example: a note named
📅 #timeline / Kia Cerato Koupmatches bothKiaandCerato, so naive search can return duplicates.Desired behavior
Search results should be deduplicated by Apple Notes
id.Example:
Should return the
Kia Cerato Koupnote once, with both terms listed:Implementation notes
seenIdslist in AppleScript, or deduplicate in shell after collecting results.id, not note name, because duplicate note titles are possible.Acceptance criteria