Search finds only files with text in filename

NC installed via snap, V19.x
Elasticsearch installed “native” (no docker etc.)

ES indes shows 130.000+ files which ist fine. Accessing ES via port 9200 is fine.

The three standard NC apps for search are installed an configured (http://localhost:9200).

Using search showqs no errors, but returns only file with the given string being part of the filename - which isn’t exactly what I expected.

Any hints to track that problem down? I did invest some time but came up empty :frowning:

Greetings Wolfgang

1 Like

result on ./occ fulltextsearch:test ?

sudo nextcloud.occ fulltextsearch:check

Full text search 1.4.2

  • Search Platform:
    Elasticsearch 1.5.2
    {
    “elastic_host”: [
    http://localhost:9200
    ],
    “elastic_index”: “nextcloud”,
    “fields_limit”: “10000”,
    “es_ver_below66”: “0”,
    “analyzer_tokenizer”: “standard”
    }

  • Content Providers:
    Deck 1.0.5
    []
    Files 1.4.3
    {
    “files_local”: “1”,
    “files_external”: “1”,
    “files_group_folders”: “1”,
    “files_encrypted”: “0”,
    “files_federated”: “0”,
    “files_size”: “100”,
    “files_pdf”: “1”,
    “files_office”: “1”,
    “files_image”: “0”,
    “files_audio”: “0”
    }

This is a bit strange, aus I would have expected to see that 130.000+ files here, that were processed by

sudo nextcloud.occ fulltextsearch:index --no-readline

Could --no-readline have something to do with the problem? I had to add it following the error message when indexing without this parameter.

Greetings Wolfgang

Meanwhile I installed a KVM machine, NC with snap, Elasticsearch as documented … and it works like it should.

I could check in my production environment, that native search for files in the index works, i.e.

sudo nextcloud.occ fulltextsearch:search “somestring” comes up with results showing the right files.

I checked my working KVM VM against my proction machine, NC config, Elasticsearch config … nothing special.

So id the OCC-comman finds files, why doesn’t to app within NC GUI? I’m really puzzeled …

Wolfgang

Meanwhile: I setup a fresh installation with Ubuntu server und Nextcloud being installed with system setup (also using snap). Added Elasticsearch - everything works as expected, i.e. search in NV returns file with search string being part of content.

I then extracted configuration data with

sudo nextcloud.occ config:list > config-list.txt

and compared the files of my two installations.

What I found was

"fulltextsearch": {
        "app_navigation": "1",
        "cron_err_reset": "1598114208",
        "enabled": "yes",
        "installed_version": "1.4.2",
        "provider_indexed": "{\"deck\":\"1\",\"files\":\"1\"}",
        "search_platform": "OCA\\FullTextSearch_ElasticSearch\\Platform\\ElasticSearchPlatform",
        "types": ""
    }

on the working server. On the failing server one line is different

	"provider_indexed": "{\"deck\":\"1\"}",

I now suspect that this maybe the reason for my problems.

Deleting the NC apps and reinstalling them did not help. Re-indexing files via

sudo nextcloud.occ fulltextsearch:index --no-readline

did not help.

So I came up with what is described in Install and configure FullTextSearch + Elasticsearch using occ / command line.

But that command fails with “The file must contain a valid json array”.

I suspect that the JSON data showed there should be inside

“system”: {}

Someone here to comment on that?

Where can I find more information regarding configuration via OCC, especially search? I did see the docs on Github, but regarding search that was not as specific as required. And reading PHP code is not my business, sorry.

Greetings Wolfgang

Hi Wolfgang, you probably did solve this - but I did stumble over the same issue. And I found a solution - so if anybody comes across the same issue - here we go.

NC 20. Debian. Elasticsearch installed “native”. No fulltextsearch happening although every other check seems to be fine.

I also did check

sudo -u www-data php /var/www/occ config:list > x.txt

and what I got was

 "fulltextsearch": {
        "app_navigation": "0",
        "search_platform": "OCA\\FullTextSearch_Elasticsearch\\Platform\\ElasticSearchPlatform",
        "enabled": "yes",
        "cron_err_reset": "1617301802",
        "installed_version": "20.0.0",
        "types": "",
        "provider_indexed": "{\"deck\":\"1\",\"test_provider\":\"0\"}"
    }

Note the "test_provider here. I did even uninstall deck…

I wanted to change the provider_indexed - finally I found the JSON format:

sudo -u www-data php /var/www/occ fulltextsearch:configure ‘{“provider_indexed”:"{“files”:“1”}"}’

Issue is: the value of provider_indexed is a string. I circumvented trouble with escaping and escaping etc by using single quotes at the outer level…

Now I get results!!!

2 Likes