8000 feat(search): leave words out with NOT or -word by adeelahmad · Pull Request #603 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(search): leave words out with NOT or -word - #603

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: search took words, "phrases" and OR, but there was no way to leave a word out; a typed NOT or -word was searched for as a word.

After: budget -draft or budget NOT draft finds lines about the budget that don't mention a draft (or drafts), and -"first draft" leaves out a phrase. A typed AND changes nothing, as every word is needed anyway. It works in the web app, the API, MCP, public pages and the assistant's search, and the "?" syntax help shows it.

How: domain/search.py parses the excluded terms and filters them out of the full-text matches (stemmed, as the index is); components/search/query.ts keeps the highlighting off excluded words.

Motivation and Context

Item from the personal feature plan sheet ("boolean search").

Screenshots (if appropriate):

n/a

Steps to reproduce (if appropriate):

Search budget -draft in a namespace with lines mentioning both.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (test_search_index.py test_not_and_minus_leave_lines_out).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/processing.md, docs/api.md).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. Written as changelog.d/search-not.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: usable through the API, MCP or an assistant tool. Same query syntax in MCP search and the assistant's tool.
  • Zero setup: no new prerequisite, .env edit or manual step.
  • Fewest clicks and keystrokes. Typed in the search box; no new control.
  • Configurable: new settings in the web app with defaults; wizard asks only what is required. n/a: no settings.
  • Light: default install still runs on a Raspberry Pi with cloud models.
  • Private and secure: data local and encrypted, passkeys, threat model updated. n/a: no new surface.
  • Cost: cheapest path, model calls in the activity ledger, budgets respected. n/a: no model calls.
  • User decides: consequential or new actions wait for the user; defaults unchanged. Queries without NOT or -word search as before.
  • Upgrades: existing installs upgrade safely (upgrade step for stored-data changes). n/a: no stored-data change.
  • Honest: sources cited; labelled built, in progress or planned.
  • Tests, docs and generated files updated. OpenAPI regenerated with the tooling.
  • Open standards; dependencies keep Lens MIT. n/a: no dependencies.
  • Result reported with evidence; "refine later" items written down.
  • Reuse: existing Lens code and permissive libraries reused, nothing reinvented. Reuses the existing full-text index and stemmer.

Local CI (ci/local-ci.sh): FastAPI (embedded and server), Next.js, pre-commit and PR title passed.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ
@adeelahmad adeelahmad self-assigned this Oct 18, 2026
Copy link
Copy Markdown
Owner Author

"Clicks and keystrokes per feature" failed only in its last step: every journey passed, then actions/upload-artifact timed out (Failed to CreateArtifact: Unable to make request: ETIMEDOUT). That's the runner's connection to GitHub, not this change. I've re-run the failed job once.


Generated by Claude Code

@adeelahmad
adeelahmad merged commit 26e576e into main Oct 18, 2026
11 of 12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-xfmkzn branch October 18, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0