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

Root object person.getPerson seems to not work properly #2402

Open
ghost opened this issue Jan 15, 2024 · 1 comment
Open

Root object person.getPerson seems to not work properly #2402

ghost opened this issue Jan 15, 2024 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 15, 2024

Hello everybody!

I'm writing to get some help or some idea about why something is happening in my Alfresco Content Service environment. I have built some extensions over my instance using Javascript based Webscripts. All of them work perfectly, however I do have one exception. The problem is: in one webscript I invoke the Javascript root object person.getPerson in this way:

 var userNodes = people.getPeople(null,0);

And it doesn't return anything, however, I do have some users registered in my instance. Also, I can see all of them using the node browser and the following Alfresco-CMIS query:

 SELECT * FROM cm:person

I tried to test the same webscript in a test instance and it worked without problems. So, I don't think the code is the problem. In addition, I have read the implementation of the root object. And I discover that, "under the hoods", the code creates the following FTS query and passes it to the SearchService:
TYPE:"{http://www.alfresco.org/model/content/1.0}person" AND ("***")

I tried to verify this query in the node browser too and it didn't return anything too. I also tried to remove the "AND ("***")" snippet from the query and then it worked without any problems.
Do someone knows what could be and why the query without "AND ("***")" works properly?

Some informations about my environment:
Alfresco's version: 6.2
Edition: Community

Thanks in advance!
Felipe

@AFaust
Copy link
Contributor

AFaust commented Sep 12, 2024

The reason for this can very well be that your Search Service / SOLR is not correctly indexing or searching person nodes. This is the reason why there is a difference in behaviour between just using TYPE and TYPE combined with the * wildcard. The latter will use SOLR to query, the former will go directly to the database.
There can also be issues with localised indexation/querying. Apart from a few pre-defined properties, any text property is indexed only for the locale that the node was created in. When you do a query as a user, you may have a different locale in your request context, and your search might not match in SOLR because of that. I have encountered such issues when a background job on the server was synchronising LDAP users using the English server locale, and me - a German admin user - was trying to search for any of them, not getting any results back. This can be solved by enabling cross-locale search in Search Services / SOLR via the shared.properties. I have done a presentation at an Alfresco conference in the past about cross-locale issues in Search Services, which may be of interest here: https://de.slideshare.net/slideshow/important-workarounds-for-making-ass-multilingual/87303198

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