05-27-2020 10:53 AM
There seems to be an issue with trying to sort on a base model field when I use a custom aspect in my query. This is the query I am trying to run:
var def = { query: 'TYPE:"cm:person" AND gf:userOrgs:RECEIVERORG', store: "workspace://SpacesStore", language: "fts-alfresco", page: { maxItems: 100, skipCount: 0 }, sort: [{ column: 'cm:userName', ascending: true }] }; var result = search.query(def);
The sort works fine when I "userName" as sort but as soons as I user "firstName" or "email" it fails. If I remove gf;userOrgs from the query it works fine. It gives the following error in the logs:
Caused by: org.alfresco.repo.search.impl.lucene.LuceneQueryParserException: 04270500 Request failed 500 /solr/alfresco/afts?wt=json&fl=DBID%2Cscore&rows=100&df=TEXT&start=0&locale=en_US&alternativeDic=DEFAULT_DICTIONARY&sort=cm%3AfirstName+asc&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON
My gf:userOrgs has been defined as an array on the user:
Collection RECEIVERORG CREATORORG
Any help would be appreciated, thanks.
06-18-2020 10:37 AM
I believe this is the solution. https://angelborroy.wordpress.com/2020/05/22/sorting-users-by-firstname-and-lastname-fields-in-alfre...
Explore our Alfresco products with the links below. Use labels to filter content by product module.