Skip to content

Fix nested query building for queries with similar properties in it

Rustam Lotsmanenko (EPAM) requested to merge bugfix-fix-nested-query into master

Description:

Bugfix for nested queries with similar properties in it, example:

"nested(data.VerticalMeasurements, (VerticalMeasurementID:\"Rotary Table\" AND VerticalMeasurement:(>30)))"

Such queries were transformed into malformed queries like:

"query_string": {
"query": "(data.data.VerticalMeasurements.VerticalMeasurements.VerticalMeasurementID:\"Rotary Table\" AND VerticalMeasurement:(>30))"

Which cause 400(Bad request) responses from elastic.

After fixing queries with similar properties works as expected:

"query_string": {
"query": "(data.VerticalMeasurements.VerticalMeasurementID:\"Rotary Table\" AND data.VerticalMeasurements.VerticalMeasurement:(>30))",

Partially solves the issue: #57 (closed)

Changes include:

  • Refactor (a non-breaking change that improves code maintainability).
  • Bugfix (a non-breaking change that solves an issue).
  • New feature (a non-breaking change that adds functionality).
  • Breaking change (a change that is not backward-compatible and/or changes current functionality).

Changes in:

  • Common code

Dev Checklist:

  • Added Unit Tests, wherever applicable.
  • Updated the Readme, if applicable.
  • Existing Tests pass
  • Verified functionality locally
  • Self Reviewed my code for formatting and complex business logic.
Edited by Rustam Lotsmanenko (EPAM)

Merge request reports

Loading