You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From #305 , I started with a stab at improving the GitHub extractor. The PR is still very much WIP, and I thought I'd create it now because I wanted to ask this question: do you want me to split github.go into separate files? Like issue.go for parsing the /owner/repo/issues/:id url, etc.
I actually have two other questions about the existing code (I'm quite new to Go):
What is the purpose of Preview? Should this be unique for each type of URL as well?
What was the purpose of the b string.Builder? Should I keep it, or use only metadata?
do you want me to split github.go into separate files?
It's up to you. Having long files is idiomatic in Go if there is no real logical separation that would make sense (e.g. our server.go). Perhaps in this case it makes sense to put different handlers to different files, but it isn't necessary.
What is the purpose of Preview? Should this be unique for each type of URL as well?
Preview() produces the result preview displayed in the right pane of the results view.
What was the purpose of the b string.Builder? Should I keep it, or use only metadata?
It collects important info from the page that is assigned to the document.Text field. The advantage of assigning the content to document.Text is that it instantly becomes searchable, while the metadata fields are not searchable by default if you don't use query filtering for those fields (e.g. metadata.language:go search query).
So information that should be instantly searchable should go to document.Text (e.g. project description) and data attributes that just provide additional information in the preview (or special filtering) should go to the metadata (e.g. stars).
Thanks for the info. I'll let you know when I'm happy with it!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From #305 , I started with a stab at improving the GitHub extractor. The PR is still very much WIP, and I thought I'd create it now because I wanted to ask this question: do you want me to split
github.gointo separate files? Likeissue.gofor parsing the/owner/repo/issues/:idurl, etc.I actually have two other questions about the existing code (I'm quite new to Go):
Preview? Should this be unique for each type of URL as well?b string.Builder? Should I keep it, or use only metadata?