Search cannot properly handle AND relationships

Steps to reproduce

Create a new file with this content.

DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT 
#searchtest1 

DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT 
#searchtest2 

DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT DUMMY CONTENT 
#searchtest1 #searchtest2

In search bar, type #searchtest1 #searchtest2 or tag:#searchtest1 tag:#searchtest2

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

One result, which is #searchtest1 #searchtest2

Actual result

4 results

Environment

SYSTEM INFO:
Obsidian version: v1.8.9
Installer version: v1.8.9
Operating system: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 23.6.0
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: light
Community theme: none
Snippets enabled: 1
Restricted mode: on

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.


Additional information

There is no bug here.

The query #searchtest1 #searchtest2 means “Finds all notes that contains both strings #searchtest1 and #searchtest2 in any place within their title and their content”.

There is no point in your query where you specify that the two strings need to be contiguous or on the same line.

The answer to your problem is in the docs, and is probably the line: operator.

1 Like

Okay, I tested the line: operator, and indeed it works. Thanks for clearifying.