Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to exempt certain file types from being treated as binary due to trigram count #138

Open
robinp-tw opened this issue Aug 17, 2021 · 1 comment

Comments

@robinp-tw
Copy link

Files larger than approx the max_trigram_count (default 20k) are treated as binary, thus excluded from content-based indexing.

If you search for lang:binary, there's chance you'll run into some large source codes or other content you still would wish to index.

The logic lives in https://github.com/google/zoekt/blob/master/indexbuilder.go#L298 . Could maybe plumb some options that excludes files of certain pattern from the "too long, probably binary" treatment (raising the trigram limit is not really as option, there's always just one more file that is above any limit and would have been nice to index).

@robinp-tw
Copy link
Author

Actually filesize-based exemption is already available, and the limit is 2MB by default. What I stumbled into is indeed the max_trigram_count. Maybe that could have a filename-based exemption similar to

} else if err := zoekt.CheckText(doc.Content, b.opts.TrigramMax); err != nil {
.

@robinp-tw robinp-tw changed the title Need to exempt certain file types from being treated as binary due to size Need to exempt certain file types from being treated as binary due to trigram count Oct 7, 2021
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

No branches or pull requests

1 participant