Skip to content

Conversation

@karthik-tarento
Copy link
Contributor

No description provided.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

87.7% 87.7% Coverage
0.0% 0.0% Duplication

@karthik-tarento
Copy link
Contributor Author

@vinukumar-vs @maheshkumargangula - Please review this PR and merge.

@karthik-tarento
Copy link
Contributor Author

@vinukumar-vs @maheshkumargangula -- any update on this PR ?

@vinukumar-vs
Copy link
Contributor

@karthik-tarento Please find the below discussion links to handle the multi-search/nested object filter
https://github.com/project-sunbird/sunbird-community/discussions/429
https://github.com/project-sunbird/sunbird-community/discussions/768

@vinukumar-vs
Copy link
Contributor

@karthik-tarento Please find the below discussion links to handle the multi-search/nested object filter project-sunbird/sunbird-community#429 project-sunbird/sunbird-community#768

I hope the above solution should work you as well. If it doesn't solve your requirement, lets discuss it detail about the requirement or share the JIRA story/ticket to understand better.

@pkranga @maheshkumargangula

@karthik-tarento
Copy link
Contributor Author

@vinukumar-vs
Please refer - https://github.com/project-sunbird/sunbird-community/discussions/429#discussioncomment-936329
From the above link - "A4: The conditions within a given filter always use AND condition. Right now we don't have ability to use OR condition. It requires enhancement. I suggest you to trigger two different API calls to support OR condition (If it works in your scenario)."
This PR is the enhancement which provides to search using OR condition. Let me know if any questions in the proposed enhancement

@vinukumar-vs vinukumar-vs changed the base branch from release-4.9.0 to release-4.10.0 May 27, 2022 04:51
filters.put("status", new ArrayList<String>());
request.put("filters", filters);
Map<String, Object> multiFilters = new HashMap<>();
multiFilters.put("competencies_v3.name", "CompetencyOne");
Copy link
Contributor

Choose a reason for hiding this comment

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

multiFilters defined but not used.

String groupByParent = (String) aggregationsMap.get("groupByParent");
Terms terms = aggregations.get(groupByParent);
Terms terms = null;
List<Bucket> buckets = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep the previous implementation for buckets.

searchSourceBuilder.aggregation(termBuilder);
} else {
if (nestedAggregation.get(groupByParent.split("\\.")[0]) != null) {
nestedAggregation.get(groupByParent.split("\\.")[0]).add(groupByParent.split("\\.")[1]);
Copy link
Contributor

Choose a reason for hiding this comment

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

See if we can assign groupByParent.split("\.")[0] to a variable and reuse it.

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