Skip to content

Treat spaces as AND operators in search#330

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/improve-search-functionality
Draft

Treat spaces as AND operators in search#330
Copilot wants to merge 3 commits intomasterfrom
copilot/improve-search-functionality

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 23, 2026

Search currently treats spaces as literal characters. Searching "android app" only matches items containing the exact phrase, not items with both words separately.

Changes

AccountViewModel.kt

  • Split search query by whitespace into individual terms
  • Pass first term to SQL for initial filtering (reduces result set at DB level)
  • Apply in-memory AND filter for multi-term queries: each term must match in at least one field (link, name, or notes)
  • Lowercase conversion optimized to happen once per search, not per result

DeeprIntegratedTest.kt

  • Added integration test for multi-keyword search behavior
  • Added helper method for creating test data with notes

Behavior

// Before
search("android app")  // matches: "android app" (exact phrase only)

// After  
search("android app")  // matches: items containing both "android" AND "app"
                      // - "Android Development" + notes: "mobile app"
                      // - "My App" + link: "play.google.com/android"
                      // - "Mobile App for Android"

Matching is case-insensitive, order-independent, and searches across all text fields. Single-word searches unchanged (no performance impact).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/gradle-daemon-main-8.13.jar (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Improving Search Functionality by Treating Spaces as AND Operators</issue_title>
<issue_description>If I’ve searched for a domain, then I can’t search by notes because it treats spaces as characters. My idea is that spaces shouldn’t be treated as characters but rather as AND operators, so searching with multiple keywords will be allowed.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 23, 2026 19:00
Co-authored-by: yogeshpaliyal <9381846+yogeshpaliyal@users.noreply.github.com>
Co-authored-by: yogeshpaliyal <9381846+yogeshpaliyal@users.noreply.github.com>
Copilot AI changed the title [WIP] Update search functionality to treat spaces as AND operators Treat spaces as AND operators in search Jan 23, 2026
Copilot AI requested a review from yogeshpaliyal January 23, 2026 19:05
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.

Improving Search Functionality by Treating Spaces as AND Operators

2 participants