nextcloud / fulltextsearch_elasticsearch

🔍 Use Elasticsearch to index the content of your Nextcloud
https://apps.nextcloud.com/apps/fulltextsearch_elasticsearch
GNU Affero General Public License v3.0
81 stars 30 forks source link

Be clear that ES7 is no longer supported #272

Closed jtrees closed 1 year ago

jtrees commented 1 year ago

The current docs are misleading. I broke my NC install because there was no indication that ES7 is no longer supported.

Hopefully this will protect another admin out there.

Source: https://github.com/nextcloud/fulltextsearch_elasticsearch/issues/269#issuecomment-1646837405

ArtificialOwl commented 1 year ago

Yes, but ES7 should still works with nc26.

jtrees commented 1 year ago

Yes, but ES7 should still works with nc26.

Interesting, I actually landed here because fulltext search stopped working after upgrading to NC 27.

R0Wi commented 1 year ago

I was having issues when trying to use app version >= 26 (which is using ES client 8) together with ES 7.x. In general I'd recommend one uses the same major version for the server and the client package. https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-api-compatibility.html

Btw: it highly depends on which exact server version you're using. For example with older versions of ES 7, the newer ES 8 client (which is included in app versions >= 26) is not compatible. Here an example when running ES 7.6.0:

  1. Run the server docker run -d -p 9200:9200 -e cluster.name=docker-cluster -e bootstrap.memory_lock=true -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" -e discovery.type=single-node --name elastic_server elasticsearch:7.6.0
  2. Create a new directory and run composer init and composer require elasticsearch/elasticsearch:8.6.1 to install the same client library as used in this app
  3. Create the following index.php:
    
    <?php

require_once 'vendor/autoload.php';

$client = Elastic\Elasticsearch\ClientBuilder::create() ->setHosts(['http://localhost:9200']) ->build();

$info = $response = $client->info();

echo($info);

4. Run the script via `php index.php`

You will see the following error:

PHP Fatal error: Uncaught Elastic\Elasticsearch\Exception\ProductCheckException: The client noticed that the server is not Elasticsearch and we do not support this unknown product in /var/www/html/elastic-test/vendor/elasticsearch/elasticsearch/src/Traits/ProductCheckTrait.php:32



which is produced because ES 7.6.0 does not set an expected header in the response (see also [here](https://github.com/nextcloud/fulltextsearch_elasticsearch/issues/257)).

So this is just one sample where client and server are not compatible and I'm sure there are many more :smile: 
julian70400 commented 1 year ago

So, if I use my elasticsearch 7.17.13, it explains why I can't find nothing with my Nextcloud 26.0.7 ?

If yes, it should be cool to avoid a bit more.. I broke my prod because of that.

R0Wi commented 1 year ago

Well.. it depends 😄 It could be the cause of the error but I'd recommend: lower your loglevel, reproduce your problem and inspect the server logs. Maybe it will show you what went wrong.

I definitely agree. To me it would make sense to add a setupcheck for this or at least have some occ fulltextsearch-command to check the compatibility of the setup properly.

julian70400 commented 1 year ago

Could it be related ?

occ fulltextsearch:test

.Testing your current setup: Creating mocked content provider. ok Testing mocked provider: get indexable documents. (2 items) ok Loading search platform. (Elasticsearch) ok Testing search platform. ok Locking process ok Removing test. ok Pausing 3 seconds 1 2 3 ok Initializing index mapping. ok Indexing generated documents. ok Pausing 3 seconds 1 2 3 ok Retreiving content from a big index (license). (size: 32386) ok Comparing document with source. ok Searching basic keywords:

fulltextsearch:test [--output [OUTPUT]] [-j|--json] [-d|--platform_delay PLATFORM_DELAY]

R0Wi commented 1 year ago

I saw this error recently. Maybe our conversation from https://github.com/nextcloud/fulltextsearch_elasticsearch/pull/237#issuecomment-1725905169 will help you.

github-actions[bot] commented 7 months ago

Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!