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

GO-4442 add weights #1789

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

GO-4442 add weights #1789

wants to merge 17 commits into from

Conversation

fat-fellow
Copy link
Contributor


  • I understand that contributing to this repository will require me to agree with the CLA

Description

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 tech-docs
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

Comment on lines +16 to +17
// Finish performs the
Finish() error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the missing part of the comment?

sort.Slice(resultsByObjectId[objectId], func(i, j int) bool {
if bleveResults[i].Score > bleveResults[j].Score {
cur := resultsByObjectId[objectId]
sort.Slice(cur, func(i, j int) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slices.SortFunc should be faster


byteToRuneIndex := make([]int, len(highlight)+1)
for i := range byteToRuneIndex {
byteToRuneIndex[i] = utf8.RuneCountInString(highlight[:i])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should work with utf16 (and please, check it in other fts places)

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

Successfully merging this pull request may close these issues.

3 participants