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: empty result set returned instead of error when providing illegal property #14

Open
driesdeproost opened this issue Oct 16, 2019 · 0 comments

Comments

@driesdeproost
Copy link
Contributor

Tested with:

eu.xenit.apix.impl-51 1.20.0

Description:

Using the alfresco/s/apix/v1/search endpoint, I would expect that when you search with an invalid property name, an error would be returned. Instead, an empty result set is returned.

This is very confusing for developers as it seems that their query was valid, and there were just no documents matching their criteria.

Use cases:

Normal use case (expected behaviour):

curl -u admin:passwordhere -v -XPOST -H 'Content-Type: application/json' https://demo.xenit.eu/alfresco/s/apix/v1/search -d '{"query":{"and":[{"property":{"name":"cm:name","value":"myFileName"}}]}}'

Returns:
{"noderefs":[123 nodeRefs here],"totalResultCount":123}

Non existent property use case (expected behaviour):

curl -u admin:passwordhere -v -XPOST -H 'Content-Type: application/json' https://demo.xenit.eu/alfresco/s/apix/v1/search -d '{"query":{"and":[{"property":{"name":"bogus","value":"myFileName"}}]}}'

Returns:
An error, indicating that the provided property is invalid

Non existent property use case (actual behaviour):

curl -u admin:passwordhere -v -XPOST -H 'Content-Type: application/json' https://demo.xenit.eu/alfresco/s/apix/v1/search -d '{"query":{"and":[{"property":{"name":"bogus","value":"myFileName"}}]}}'

Returns:
{"noderefs":[],"totalResultCount":0}

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

No branches or pull requests

1 participant