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

MB-47476: JSON marshalers cannot work on 0xff (HighTerm) #1608

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

abhinavdangeti
Copy link
Member

@abhinavdangeti abhinavdangeti commented Jul 21, 2021

Using unicode/utf8's MaxRune as the HighTerm for sort while
missing values.

Using unicode/utf8's MaxRune as the `HighTerm` for sort while
missing values.
@abhinavdangeti abhinavdangeti changed the title MB-47476: JSON marshalers cannot work on a byte > 0x7f MB-47476: JSON marshalers cannot work on 0xff (HighTerm) Jul 26, 2021
search/sort.go Outdated

"github.com/blevesearch/bleve/v2/geo"
"github.com/blevesearch/bleve/v2/numeric"
)

var HighTerm = strings.Repeat(string([]byte{0xff}), 10)
var HighTerm = string(utf8.MaxRune)
Copy link
Contributor

Choose a reason for hiding this comment

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

one thought is that we repeat the max rune 3x, that way get 12 bytes (approximately as long as the byte sequence we had before)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, sounds good.

len(utf8.MaxRune) = 4 bytes
@abhinavdangeti abhinavdangeti merged commit b919b39 into blevesearch:master Jul 28, 2021
abhinavdangeti added a commit that referenced this pull request Jul 28, 2021
* MB-47476: JSON marshalers cannot work on `0xff` (HighTerm)
    Using unicode/utf8's MaxRune as the `HighTerm` for sort while
    missing values.

* Increase HighTerm length to > 10bytes
    len(utf8.MaxRune) = 4 bytes
abhinavdangeti added a commit that referenced this pull request Jul 28, 2021
(#1608)

* MB-47476: JSON marshalers cannot work on `0xff` (HighTerm)
    Using unicode/utf8's MaxRune as the `HighTerm` for sort while
    missing values.

* Increase HighTerm length to > 10bytes
    len(utf8.MaxRune) = 4 bytes
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