Skip to content

[2.0] Add UNF flag for SORTABLE fields (#2188) Improve FT.INFO complexity to O(1) (#2153)#2201

Merged
ashtul merged 4 commits into2.0from
cp-2188-to-2.0
Aug 24, 2021
Merged

[2.0] Add UNF flag for SORTABLE fields (#2188) Improve FT.INFO complexity to O(1) (#2153)#2201
ashtul merged 4 commits into2.0from
cp-2188-to-2.0

Conversation

@ashtul
Copy link
Copy Markdown
Contributor

@ashtul ashtul commented Aug 23, 2021

Cherry-pick PR #2188 and #2153 to 2.0 branch.

* Add UNF flag for SORTABLE fields

* add test

(cherry picked from commit aa9808d)
@ashtul ashtul requested a review from rafie August 23, 2021 09:14
const char *c = RedisModule_StringPtrLen(field->text, &fl);
if (FieldSpec_IsSortable(fs)) {
RSSortingVector_Put(aCtx->sv, fs->sortIdx, (void *)c, RS_SORTABLE_STR);
RSSortingVector_Put(aCtx->sv, fs->sortIdx, (void *)c, RS_SORTABLE_STR, fs->options & FieldSpec_UNF);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like to booleanize bitmask expresions (!!(fs->options & FieldSpec_UNF)). Not a must.

rafie
rafie previously approved these changes Aug 23, 2021
* Improve FT.INFO complexity to O(1)

* split cardinality and size for MemUsage

* Per meir's review

* per review

(cherry picked from commit e1a8af5)
@ashtul ashtul changed the title [2.0] Add UNF flag for SORTABLE fields (#2188) [2.0] Add UNF flag for SORTABLE fields (#2188) Improve FT.INFO complexity to O(1) (#2153) Aug 23, 2021
@ashtul ashtul requested a review from rafie August 23, 2021 14:38
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 23, 2021

Codecov Report

Merging #2201 (4e54c3d) into 2.0 (a5174d5) will decrease coverage by 0.00%.
The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.0    #2201      +/-   ##
==========================================
- Coverage   80.18%   80.18%   -0.01%     
==========================================
  Files         146      146              
  Lines       21086    21091       +5     
==========================================
+ Hits        16908    16911       +3     
- Misses       4178     4180       +2     
Impacted Files Coverage Δ
src/document.c 74.75% <66.66%> (-0.31%) ⬇️
src/sortable.c 63.20% <100.00%> (ø)
src/spec.c 84.56% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5174d5...4e54c3d. Read the comment docs.

@ashtul ashtul merged commit 3953caa into 2.0 Aug 24, 2021
@ashtul ashtul deleted the cp-2188-to-2.0 branch August 24, 2021 05:33
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