Open ostasevych opened 1 year ago
To be able to debug the ES queries generated by this app, I'd recommend to set your loglevel to 0
in your config.php
. The app should then log the query which is sent to the ES server before actually sending it (you should see some log message like Searching ES ...
after your sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:search ...
command).
Unfortunately the debug logging is currently broken, that's why you might need to adjust the following code a bit to be able to actually see the query body:
try {
$serializedParams = var_export($query['params'], true);
$this->logger->debug('Searching ES: ' . $serializedParams);
$result = $client->search($query['params']);
}
(Will try to bring in a PR to fix the debug logging within the next days).
After that, analyze the JSON query which is sent to ES and now written to your NC log. Most likely it will contain a filter
section which tries to ensure that users do not see results for files where they don't have permissions. Try to figure out which of these filters are filtering out your expected results. I'd guess that the share_names
array is the culprit:
"share_names" : {
"user0" : "GroupA/Applications/Ivanova.docx",
"user6" : "GroupA/Applications/Ivanova.docx",
"user3" : "",
},
A ES document is only visible to his owner
or in your case also to anyone listed in the share_names
array. Think your documents share_name
entries are just missing most of your users (I'd expect users 1-10 to be listed here ...).
That would be a hint that your index process ended with errors. In that case please reindex your documents end inspect your Nextcloud logfile while leaving the loglevel
set to 0
.
Out of curiosity: https://github.com/nextcloud/fulltextsearch_elasticsearch#compatibility says the app is ONLY compatible with ES 7? OP has used a container with ES 8.6.1 -- please somebody clarify if this CAN even work?
Docs are outdated. If you have a look at the composer
dependencies, you'll see that since app version 26 the ES client 8.6.1 is used. So app version >=26 is ONLY compatible with ES server 8.6.x.
Docs are outdated. If you have a look at the
composer
dependencies, you'll see that since app version 26 the ES client 8.6.1 is used. So app version >=26 is ONLY compatible with ES server 8.6.x.
Thanks for the clarification. As always, the real information is buried in the sources. Wouldn't it be a nice gesture to the admin who wants to install this app for his users: let him know upfront that this app is compatible with a distinct ElasticSearch version? (in Nextcloud admin panel -> apps -> fulltextsearch_elasticsearch -> details)?
Now I'm fully on track: NC on 26.0.4, ES on 8.6.1. And it seems the same result as described here: everything is fully indexed (index rebuilt with zero errors), but the query for files does not yield results. In particular:
Shall I open a new issue for this (the difference is: there are no groupfolders involved) or which info do you need to track this down?
Now I'm fully on track: NC on 26.0.4, ES on 8.6.1. And it seems the same result as described here: everything is fully indexed (index rebuilt with zero errors), but the query for files does not yield results. In particular:
- I can query manually /indexname/_query?q=a_search_term and I get the expected entries. I can verify that all the infos around the document (owner, shares, groups etc.) are there.
- A query done by occ fulltextsearch:query does not show this result, even if the querying user is the owner of the document, or verifiable in the 'users' array as well as in the 'share_names' dictionary. Other content providers don't seem to be affected (I have deck, this returns expected results).
Shall I open a new issue for this (the difference is: there are no groupfolders involved) or which info do you need to track this down?
Reading your observations, I understand that the issue is hiding somewhere deeper. After the initial indexing, which has brought ambiguous results the elasticsearch+nexrtcloud starts working fine, so, when I modify or delete or add some document the cron does it work and the documents are indexing properly independently of either local or group folders.
Now I'm fully on track: NC on 26.0.4, ES on 8.6.1. And it seems the same result as described here: everything is fully indexed (index rebuilt with zero errors), but the query for files does not yield results. In particular:
- I can query manually /indexname/_query?q=a_search_term and I get the expected entries. I can verify that all the infos around the document (owner, shares, groups etc.) are there.
- A query done by occ fulltextsearch:query does not show this result, even if the querying user is the owner of the document, or verifiable in the 'users' array as well as in the 'share_names' dictionary. Other content providers don't seem to be affected (I have deck, this returns expected results).
Shall I open a new issue for this (the difference is: there are no groupfolders involved) or which info do you need to track this down?
I have decided to open #277 for this problem. It seems too different from this issue which is about indexing.
Hi! I am asking for help. Almost a week after moving from server installed elasticsearch to the dockerised I am struggling to make the full text search working on my instance:
Reindexing done with the following commands:
Searching with curl in index "my-index" for the word "Ivanova" (our member) gives (user data are stripped and scratched):
Next, I search for Ivanova on behind of a user0
The documents are stored in the groupfolder, which is accessible to
user0
,user1
,user2
,user3
,user10
, but that's what I see when searching with the help of NC fulltextsearch app:Obviously, users in webUI cannot see the proper output.
Would you be so kind to explain, why it is not working as expected? What should I do to make it working? Thanks!