Giter Club home page Giter Club logo

Comments (11)

junkblocker avatar junkblocker commented on June 1, 2024 2

Still, can’t help a feeling binary file skipping merits to be done via some command line switch, like -maxlinelen defaulting to 2000.

You might be interested in using my fork that implements this and some other options https://github.com/junkblocker/codesearch .

from codesearch.

dgryski avatar dgryski commented on June 1, 2024 1

The files that are skipped generally are thought to be binary files -- those with very long lines or too many invalid utf8 characters.

from codesearch.

rns avatar rns commented on June 1, 2024 1

Here is how the file skipping is decided:

// Tuning constants for detecting text files.
// A file is assumed not to be text files (and thus not indexed)
// if it contains an invalid UTF-8 sequences, if it is longer than maxFileLength
// bytes, if it contains a line longer than maxLineLen bytes,
// or if it contains more than maxTextTrigrams distinct trigrams.
const (
	maxFileLen      = 1 << 30
	maxLineLen      = 2000
	maxTextTrigrams = 20000
)

// Tuning constants for detecting text files.

When I faced the same file skipping issue, I just changed maxLineLen to 10000 and recompiled and reindexed and everything worked just fine. Quick and dirty hack as it is.

Still, can’t help a feeling binary file skipping merits to be done via some command line switch, like -maxlinelen defaulting to 2000.

from codesearch.

rns avatar rns commented on June 1, 2024 1

@nmklong go build, go install as described in https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies after changing the source file locally.

I’m not quite sure about that, but go get -u might well undo any changes you made locally.

from codesearch.

junkblocker avatar junkblocker commented on June 1, 2024

You can run with -logskip flag to see why the files were skipped.

from codesearch.

nmklong avatar nmklong commented on June 1, 2024

@junkblocker I ran csearch -logskip "terms" but it's saying it's an incorrect flag

from codesearch.

junkblocker avatar junkblocker commented on June 1, 2024

The flag applies at indexing time to cindex and not at search time to csearch.

from codesearch.

nmklong avatar nmklong commented on June 1, 2024

@junkblocker Tried cindex -logskip ./ but it's still saying incorrect flag

from codesearch.

rns avatar rns commented on June 1, 2024

@junkblocker: ah, good to know, thanks!

from codesearch.

nmklong avatar nmklong commented on June 1, 2024

@rns thanks for that, but a noob question: how to recompile go after modifying the code locally?

I tried go get -u ~/localgocode/src/github.com/google/codesearchbut it didn't work, ~/localgocode is my GOPATH

from codesearch.

nmklong avatar nmklong commented on June 1, 2024

@rns thanks for your great help! got it working now

from codesearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.