nextcloud / fulltextsearch

🔍 Core of the full-text search framework for Nextcloud
GNU Affero General Public License v3.0
212 stars 51 forks source link

How do you configured Elasticsearch to run fulltextsearch:index? Nextcloud 20 Snap Ubuntu 20.04 #603

Open Jsalas424 opened 3 years ago

Jsalas424 commented 3 years ago

I followed the "Basic Installation" instructions here: https://github.com/nextcloud/fulltextsearch/wiki/Basic-Installation . I'm running Nextcloud snap in Ubuntu 20.04.

I installed elasticsearch with these instructions: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-20-04 and is running

jon@nextcloud:/$ sudo systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-01-16 19:38:14 UTC; 10min ago
       Docs: https://www.elastic.co
   Main PID: 80065 (java)
      Tasks: 62 (limit: 5821)
     Memory: 1.2G
     CGroup: /system.slice/elasticsearch.service
             ├─80065 /usr/share/elasticsearch/jdk/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfi>
             └─80264 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

Jan 16 19:37:42 nextcloud systemd[1]: Starting Elasticsearch...
Jan 16 19:38:14 nextcloud systemd[1]: Started Elasticsearch.

jon@nextcloud:/$ curl -X GET 'http://localhost:9200'
{
  "name" : "nextcloud",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "878MPanmSu-pwoVlSr2z6A",
  "version" : {
    "number" : "7.10.2",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "747e1cc71def077253878a59143c1f785afa92b9",
    "build_date" : "2021-01-13T00:42:12.435326Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

But I can't index!

jon@nextcloud:/$ sudo nextcloud.occ fulltextsearch:index

In Index.php line 225:

  Please install php-readline, or use --no-readline  

fulltextsearch:index [--output [OUTPUT]] [-r|--no-readline] [--] [<options>]

Elasticsearch ins't configured properly I guess?

jon@nextcloud:/$ sudo nextcloud.occ fulltextsearch:test

.Testing your current setup:  
Creating mocked content provider. ok  
Testing mocked provider: get indexable documents. (2 items) ok  
Loading search platform. fail 
In ConfigService.php line 126:

  Your ElasticSearchPlatform is not configured properly  

fulltextsearch:test [--output [OUTPUT]] [-j|--json] [-d|--platform_delay PLATFORM_DELAY]
jon@nextcloud:/$ sudo nextcloud.occ fulltextsearch:check
Full text search 20.0.0

- Search Platform:
Elasticsearch 20.0.0 (Selected)
(not configured) 

- Content Providers:
Files 20.0.0
{
    "files_local": "1",
    "files_external": "1",
    "files_group_folders": "1",
    "files_encrypted": "0",
    "files_federated": "0",
    "files_size": "20",
    "files_pdf": "1",
    "files_office": "1",
    "files_image": "0",
    "files_audio": "0"
}
Jsalas424 commented 3 years ago

Edit: I got a little farther. I neeeded to include this in my NC config:

image

 jon@nextcloud:/$ sudo nextcloud.occ fulltextsearch:check
Full text search 20.0.0

- Search Platform:
Elasticsearch 20.0.0 (Selected)
{
    "elastic_host": [
        "://localhost:9200"
    ],
    "elastic_index": "nextcloud",
    "fields_limit": "10000",
    "es_ver_below66": "0",
    "analyzer_tokenizer": "standard"
} 

- Content Providers:
Files 20.0.0
{
    "files_local": "1",
    "files_external": "1",
    "files_group_folders": "1",
    "files_encrypted": "0",
    "files_federated": "0",
    "files_size": "20",
    "files_pdf": "1",
    "files_office": "1",
    "files_image": "0",
    "files_audio": "0"
}

jon@nextcloud:/$ sudo nextcloud.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:  
 - 'test' (result: 1, expected: ["simple"]) ok  
 - 'document is a simple test' (result: 2, expected: ["simple","license"]) ok  
 - '"document is a test"' (result: 0, expected: []) ok  
 - '"document is a simple test"' (result: 1, expected: ["simple"]) ok  
 - 'document is a simple -test' (result: 1, expected: ["license"]) ok  
 - 'document is a simple +test' (result: 1, expected: ["simple"]) ok  
 - '-document is a simple test' (result: 0, expected: []) ok  
 - 'document is a simple +test +testing' (result: 1, expected: ["simple"]) ok  
 - 'document is a simple +test -testing' (result: 0, expected: []) ok  
 - 'document is a +simple -test -testing' (result: 0, expected: []) ok  
 - '+document is a simple -test -testing' (result: 1, expected: ["license"]) ok  
 - 'document is a +simple -license +testing' (result: 1, expected: ["simple"]) ok  
Updating documents access. ok  
Pausing 3 seconds 1 2 3 ok  
Searching with group access rights:  
 - 'license' - [] -  (result: 0, expected: []) ok  
 - 'license' - ["group_1"] -  (result: 1, expected: ["license"]) ok  
 - 'license' - ["group_1","group_2"] -  (result: 1, expected: ["license"]) ok  
 - 'license' - ["group_3","group_2"] -  (result: 1, expected: ["license"]) ok  
 - 'license' - ["group_3"] -  (result: 0, expected: []) ok  
Searching with share rights:  
 - 'license' - notuser -  (result: 0, expected: []) ok  
 - 'license' - user2 -  (result: 1, expected: ["license"]) ok  
 - 'license' - user3 -  (result: 1, expected: ["license"]) ok  
Removing test. ok  
Unlocking process ok  
 jon@nextcloud:/$ 

But I still cannot index!!!

jon@nextcloud:/$ sudo nextcloud.occ fulltextsearch:index

In Index.php line 225:

  Please install php-readline, or use --no-readline  

fulltextsearch:index [--output [OUTPUT]] [-r|--no-readline] [--] [<options>]
Jsalas424 commented 3 years ago

It WILL run with the --no-readline option but will NOT run if you install php-readline

jon@nextcloud:~$ sudo apt-get install php-readline 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php-readline is already the newest version (2:7.4+75).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
jon@nextcloud:~$ sudo nextcloud.occ fulltextsearch:index 

In Index.php line 225:

  Please install php-readline, or use --no-readline  

fulltextsearch:index [--output [OUTPUT]] [-r|--no-readline] [--] [<options>]
agostonl119 commented 2 years ago

It WILL run with the --no-readline option but will NOT run if you install php-readline

jon@nextcloud:~$ sudo apt-get install php-readline 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php-readline is already the newest version (2:7.4+75).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
jon@nextcloud:~$ sudo nextcloud.occ fulltextsearch:index 

In Index.php line 225:

  Please install php-readline, or use --no-readline  

fulltextsearch:index [--output [OUTPUT]] [-r|--no-readline] [--] [<options>]

phpenmod readline