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

🔎 Search by UUID #297

Merged
merged 2 commits into from
Jun 11, 2020
Merged

🔎 Search by UUID #297

merged 2 commits into from
Jun 11, 2020

Conversation

rowanseymour
Copy link
Contributor

No description provided.

@@ -172,7 +172,7 @@ func conditionToElasticQuery(env envs.Environment, resolver contactql.Resolver,

// if we are looking for unset, inverse our query
if c.Comparator() == contactql.ComparatorEqual {
query = elastic.NewBoolQuery().MustNot(query)
query = not(query)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unrelated.. just added a util method below to reduce some repetition

} else if key == contactql.AttributeID {
if c.Comparator() == contactql.ComparatorEqual {
return elastic.NewIdsQuery().Ids(value), nil
} else if c.Comparator() == contactql.ComparatorNotEqual {
return not(elastic.NewIdsQuery().Ids(value)), nil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed the goflow side allows != for everything so thinking that's fine and allow it for id and uuid.. lets users exclude contacts from larger queries.. assuming this performs ok in elastic?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, don't think there should be any issues there.

@rowanseymour rowanseymour requested a review from nicpottier June 10, 2020 22:46
@codecov
Copy link

codecov bot commented Jun 10, 2020

Codecov Report

Merging #297 into master will increase coverage by 0.02%.
The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
+ Coverage   53.54%   53.57%   +0.02%     
==========================================
  Files         101      101              
  Lines        8904     8914      +10     
==========================================
+ Hits         4768     4776       +8     
- Misses       3438     3440       +2     
  Partials      698      698              
Impacted Files Coverage Δ
search/search.go 85.95% <95.65%> (-0.22%) ⬇️

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 96a8bc4...7f2229c. Read the comment docs.

} else if key == contactql.AttributeID {
if c.Comparator() == contactql.ComparatorEqual {
return elastic.NewIdsQuery().Ids(value), nil
} else if c.Comparator() == contactql.ComparatorNotEqual {
return not(elastic.NewIdsQuery().Ids(value)), nil
Copy link
Member

Choose a reason for hiding this comment

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

Yes, don't think there should be any issues there.

@rowanseymour rowanseymour merged commit e5041de into master Jun 11, 2020
@rowanseymour rowanseymour deleted the search_by_uuid branch June 11, 2020 14:27
rasoro pushed a commit to Ilhasoft/mailroom that referenced this pull request Mar 10, 2023
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.

2 participants