google / zoekt

Fast trigram based code search
1.69k stars 113 forks source link

Highlight filepath matches in the filename display #46

Open keegancsmith opened 6 years ago

keegancsmith commented 6 years ago

Reproduction on public instance. This should have no matches, but instead it is returning a single match for line 0, but that is not the line.

https://cs.bazel.build/search?q=mapreduce.*raw+r%3Ahadoop++f%3ARawKeyValueIterator&num=50

image

hanwen commented 6 years ago

this is working as intended, albeit not documented.

"str"

gets expanded to

(OR file:"str" content:"str")

if you want to search for content specifically, you can use

content:mapreduce

This has two reasons:

I'm open to suggestions on how to make this more obvious.

keegancsmith commented 6 years ago

Yeah that makes a lot of sense. I think the bit that is surprising to me is how it is displayed in the UI, where it looks like another line match.

hanwen commented 6 years ago

Happy for a patch that changes the display too. Maybe we could do match highlighting on filenames in general.