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: Property values that can never match should be filtered out #42

Closed
driesdeproost opened this issue Jun 19, 2020 · 1 comment · Fixed by #44
Closed

Search: Property values that can never match should be filtered out #42

driesdeproost opened this issue Jun 19, 2020 · 1 comment · Fixed by #44
Assignees

Comments

@driesdeproost
Copy link
Contributor

driesdeproost commented Jun 19, 2020

It is currently possible to search for a property, with a value that is impossible to exist, due to type definitions in Alfresco. An easy example which can be used to reproduce this, is the sys:node-dbid property, which is a property of type d:long. Searching for that property with a value of Long.MAX_VALUE + 1 will return an error. Searching with Long.MAX_VALUE succeeds and just returns an empty set (as no one has that many nodes).

curl -v -u admin:admin localhost:32787/alfresco/s/apix/v1/search -XPOST -H 'Content-Type: application/json' -d '{"query":{"and":[{"or":[{"property":{"name":"sys:node-dbid","value":"9223372036854775808"}}]}]}}'

Systems that query Alfresco (through Alfred Api for example) should not need to know about the datatype of properties that are in the custom models of the Alfresco. In our case, a system (Alfred Finder) expands a value to all sets of property name : that value
As a necessary workaround, Alfred Api can check the datatype using the Alfresco DictionaryService and filter out the terms that do not comply with the datatype of their property value, before sending out the query to Alfresco.

@driesdeproost driesdeproost self-assigned this Jun 19, 2020
@driesdeproost
Copy link
Contributor Author

After more research, we opened a support ticket at Alfresco. This is an issue that only starts occurring after using Solr 6.
Related issues:
https://myalfresco.force.com/support/CaseView?id=5003z000028YOD5
Alfresco/SearchServices#334
https://issues.alfresco.com/jira/browse/MNT-19252

We will need a workaround in Alfred Api, as we don't expect the fix in Alfresco to be backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant