Skip to content

feat: support find by text and filter#740

Merged
JoanFM merged 5 commits intomainfrom
feat-text-filter-find
Nov 10, 2022
Merged

feat: support find by text and filter#740
JoanFM merged 5 commits intomainfrom
feat-text-filter-find

Conversation

@AnneYang720
Copy link
Copy Markdown
Contributor

@AnneYang720 AnneYang720 commented Nov 9, 2022

This PR is related to #738

Goals:

  • support find by text and filter for ElasticSearch
  • also support that for Redis (if needed)
  • add tests

@AnneYang720 AnneYang720 marked this pull request as draft November 9, 2022 13:52
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 9, 2022

Codecov Report

Base: 87.54% // Head: 84.39% // Decreases project coverage by -3.15% ⚠️

Coverage data is based on head (c9bf88f) compared to base (02c7899).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #740      +/-   ##
==========================================
- Coverage   87.54%   84.39%   -3.16%     
==========================================
  Files         133      133              
  Lines        6649     6651       +2     
==========================================
- Hits         5821     5613     -208     
- Misses        828     1038     +210     
Flag Coverage Δ
docarray 84.39% <100.00%> (-3.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
docarray/array/mixins/find.py 89.13% <100.00%> (-1.30%) ⬇️
docarray/array/storage/elastic/find.py 96.36% <100.00%> (+0.06%) ⬆️
docarray/array/storage/redis/find.py 63.30% <100.00%> (+1.03%) ⬆️
docarray/array/mixins/embed.py 9.89% <0.00%> (-82.42%) ⬇️
docarray/array/mixins/evaluation.py 9.09% <0.00%> (-79.03%) ⬇️
docarray/array/storage/memory/find.py 46.29% <0.00%> (-48.15%) ⬇️
docarray/array/mixins/group.py 71.05% <0.00%> (-18.43%) ⬇️
docarray/math/helper.py 67.64% <0.00%> (-17.65%) ⬇️
docarray/array/mixins/match.py 83.33% <0.00%> (-8.34%) ⬇️
docarray/array/mixins/setitem.py 74.16% <0.00%> (-8.34%) ⬇️
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@AnneYang720 AnneYang720 marked this pull request as ready for review November 10, 2022 01:34

results = da.find('pizza', filter=filter)

assert all([int(r.id) < 10 for r in results]) == True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

first u need to assrt length of results is larger than 0, otherwise I think the next asserts would still work

results = da.find('pizza', filter=filter)

assert all([int(r.id) < 10 for r in results]) == True
assert all([r.tags['i'] < 10 for r in results]) == True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no need to do == True

@JoanFM JoanFM merged commit 56018e5 into main Nov 10, 2022
@JoanFM JoanFM deleted the feat-text-filter-find branch November 10, 2022 09:46
@JoanFM JoanFM linked an issue Nov 10, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: elasticsearch query dsl is not supported correctly

3 participants