fulltextsearch icon indicating copy to clipboard operation
fulltextsearch copied to clipboard

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

Open kevinkuan1969 opened this issue 2 years ago • 6 comments

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 avatar Jun 05 '23 07:06 kevinkuan1969

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

kevinkuan1969 avatar Jun 06 '23 09:06 kevinkuan1969

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 avatar Aug 27 '23 21:08 wickeddoc87

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: https://github.com/nextcloud/fulltextsearch/issues/768

wickeddoc87 avatar Aug 28 '23 19:08 wickeddoc87

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$ 

vbier avatar Sep 07 '23 05:09 vbier

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

XueSheng-GIT avatar Oct 03 '23 03:10 XueSheng-GIT

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? :raised_eyebrow:

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

ojdo avatar Dec 04 '23 14:12 ojdo