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

How to enable Elasticsearch to all the users (including non admin) #751

Open
kevinkuan1969 opened this issue Jun 5, 2023 · 6 comments
Open

Comments

@kevinkuan1969
Copy link

Fresh install Nextcloud from 26.0.0 to 26.0.2 with Elasticsearch Version: 8.7.1.
All work well for the first 2 users with admin role.

Started to create few new users without admin role and discovered the UI search has no any result return.
Issue the following command to double confirm but still the same result.

sudo -u www-data php occ fulltextsearch:search "userxxx" xxxxxxx
search
Deck
Files

In the command of php occ filetextsearh:live, the elasticsearch seems to perform the indexing but always status is waiting
image
image

Kindly advise is the elasticsearch to allow install in Nextcloud only limit for certain number of users or any settings need to be applied. Thanks.

@kevinkuan1969
Copy link
Author

Using command below to check the difference between the two documents from successful user vs non successful user. The non successful user who cannot return any result from Elasticsearch contains NULL value in User field.

sudo -u www-data php occ fulltextsearch:document:platform files

image
image

@wickeddoc87
Copy link

we do have the same error with nextcloud 27.0.2 and elasticsearch:8.8.1.

@kevinkuan1969 have you been able to get fulltext search to work with non admin useres?

@wickeddoc87
Copy link

wickeddoc87 commented Aug 28, 2023

I’ve really been chasing this bug for 2 weeks now and I can now reproduce it too…

The problem is the user and/or groupname!

user:
test = working
test3 = working
test 3 = not working
Test_3 = not working…

group:
testgroup, test3group = working
test group = is not working

The username has to be a simple string of letters and numbers, as soon as there is a special character, a space or something else, the fulltext search no longer works!

see: #768

@vbier
Copy link

vbier commented Sep 7, 2023

It looks like this also breaks search for LDAP users. With a fresh install, search only works for some locally created users, and returns no results for LDAP users. This might be caused by the fact that LDAP users in my instance have user ids like 60F6372C-F199-4C5E-904F-287360B07F46.

The problem is easy to reproduce. Install AIO with the Fulltext-Search enabled. Create two users, one named "local" and one named "local-user". Log in with both users so that documents exist and create the index afterwards by calling

occ fulltextsearch:index

This works without errors, but searching (e.g. for term yours) only works for user "local", regardless if you search from the command line or the web interface:

dafc642965c4:/var/www/html$ php occ fulltextsearch:SEARCH local yours
search
> Files
 - 2433 score:0
 - 2450 score:0
dafc642965c4:/var/www/html$ php occ fulltextsearch:SEARCH local-test yours
search
> Files
dafc642965c4:/var/www/html$ 

@XueSheng-GIT
Copy link

Does this issue still exist with the latest fulltextsearch releases? There were some changes in regards to indexing and users.

@ojdo
Copy link

ojdo commented Dec 4, 2023

I'm coming here from a fresh nextcloud-aio (manual installation flavor) installation and experiencing the OP's issue, i.e.

  • user admin fulltextsearch just works, index is refreshed out-of-the-box, probably at cron speed.
  • any other user's search index initially remains empty.

Manually triggering the index using

sudo -u www-data php ./occ fulltextsearch:index '{"user": "janedoe"}'

works (thanks to Wiki for providing an example), and apparently keeps the index updated from then on. Am I supposed to manually triggered for each new user? 🤨

Note that this is not caused by #751, all my usernames are matched by [a-z]+.

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

No branches or pull requests

6 participants