Line-by-line search shows results multiple times

When using line-by-line search using the line:(...) operator combined with AND (which is simply space) each line is returned multiple times in the search results.

Steps to reproduce


The screenshot shows a note that has lines satisfying a line-by-line search query.

Expected result

Each line that matches search query should only be shown once in search results

Actual result

Each line is shown twice in the search results

This is how it works currently. I suggest you open a feature request for this. Regular expressions work the way you expect.

In the future, post bug reports without css or third party plugins as specified in the bug report template.

@naman
it works if you change your search query to “line:(/.*/ (word1 word2))”.
You can also use all search operators like “line:(/.*/ (word1 OR word2))”, “line:(/.*/ (word1 -word2))” etc.
BR Hupo

Thanks Hupo. This is super helpful. I suspected a workaround should be possible using regex, but not too proficient in it to figure out myself. This is great and super useful.