joemfb / ml-common-ng

An angular module of common components for the MarkLogic REST API
https://joemfb.github.io/ml-common-ng/
2 stars 2 forks source link

structured query validation error #26

Open sparnell opened 7 years ago

sparnell commented 7 years ago

There may be an issue in the structured query construction for range indexes. The return statement starting on line 901 in dist/ml-common-ng.js,

return {
      'range-constraint-query': {
        'constraint-name': name,
        'range-operator': operator || 'EQ',
        'value': asArray(values),
        'range-option': asArray(options)
      }
    };
  },

is causing a schema validation error due to the order of the properties (MarkLogic version 8.0-5.8). From what I can tell the order should be (constraint-name, value, range-operator, range-option). Changing the order fixed it for me. Can you confirm this?

Scott

rjkennedy98 commented 6 years ago

Hi, This is causing slush facets to fail. Is there a work around for this? Can we use a different version? Richard

grtjn commented 6 years ago

Does it help to turn off options validation? It is one of the rest api properties.

rjkennedy98 commented 6 years ago

@grtjn Yes that is a valid work around. I do think this should be fixed anyways. One shouldn't have to turn off query validation for it to work.