2020-03-19 00:00:00

Technologyconfiguration|debian|elastic|full text|guide|how-to|install|java|nextcloud|search|setup

How to set up Elastic full text search for Nextcloud

The default search function in Nextcloud is a simple program that can find a document if you happen to correctly remember a word in the file name you are looking for. If you want to search for any text in the contents of Files, Notes, Bookmarks and in other apps that save their content as files, you need a full text search solution for Nextcloud. Elasticsearch can deliver it to you.

Elastic is a complex general purpose indexing system that the company behind the product provides both as a service and as a downloadable product primarily for enterprises and public administration. Nonetheless, a free version of the search program is available in Nextcloud Apps directory. Elasticsearch can be installed and configured manually after Nextcloud server is up and running.

Usually, when an app is available in the Apps directory, it means the app is easy to install. That's not the case with Elasticsearch. It can be confusing to set up with instructions scattered around in many places. Here is our guide for setting up Elasticsearch for Nextcloud.

The system configuration that we had when we studied Elasticsearch was Nextcloud 18 (Hub), PHP 7.3, Elasticsearch server 6.8.6, Elasticsearch app 1.5.0 and Java openjdk 11.0.6, all running on the same Debian 10 server.

Before you start, it is worth noting that Elasticsearch requires a large share of system resources. Once the new shiny search engine is running, you'll see that the default configuration of Elasticsearch has allocated more than 1GB of RAM.

1. Install Nextcloud apps for Elasticsearch

In your browser, open Nextcloud Apps directory, select Search in the left pane, and install three Search apps:

Full text search
Full text search - Elasticsearch platform
Full text search - Files
(Full text search - Bookmarks: this was untested, so we didn't try it)

Next, let's jump deep into Elasticsearch engine installation.

2. Install Elasticsearch server programs

First, you must install Java runtime on your server if you already don't have it. Enter, for instance, the following command to check for Java:

java --version

If you need to install Java (on Debian):

apt-get install openjdk-11-jre

The command installs the Open jdk version of Java. Another choice is Oracle Java.

Second, install apt-key for the Elastic server ( source):

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

Third, add Elastic repository into your system:

echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list

Fourth, install the search engine:

apt-get update
apt-get install elasticsearch

If you want to search inside PDF and other non-ascii text documents, install a plugin (adjust the beginning of the path to your system - bin/elasticsearch-plugin is constant):

/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment

3. Start the full text search engine

systemctl start elasticsearch

Commands stop and status let you stop the engine and view its status.

4. Test the setup

Run the following command to test the setup so far (even if you are root, you must sudo because the command must be run as www-data):

sudo -u www-data ./occ fulltextsearch:test
elasticsearch installation test run
Elasticsearch test run.

5. Indexing

The first time, indexing of content must be started manually:

sudo -u www-data ./occ fulltextsearch:index

After this, the index should update automatically. It may, however, take days (I think it took a week to update our test system) for the index to update in the free version of the software. Commercial version updates the index much faster.

You Are Ready to Search

Open Nextcloud in your browser and select the Search tool in the top toolbar.

full text search for nextcloud file contents: elasticsearch

News

2025-01-21 18:01:00

Well, they are capitals of European countries that have been awarded an extra honor for 2025 by the #EU Commission. These capital awards are annual, so here are the cities selected to represent the best city in each category in 2025. #Europehttps://klaava.com/sure-states-have-capitals-but-in-europe-there-are-also-culture-smart-and-green-capitals/


News

2025-01-15 08:59:00

Not to mention travel – when real life experiences in a destination don’t match the expectations and everything that can go wrong, goes wrong. Well, that’s the beauty of #travel. #Europehttps://klaava.com/nitpickers-travel-journal-travel-lessons-learned-in-2024/


News

2025-01-11 13:25:00

A conclusion from the Traffic Scorecard 2024 results is it takes about double the time to drive along the streets of London (the most congested city in #Europe) than the streets of Munich, which is ranked the 21st most congested European city. #traffic #travelhttps://klaava.com/the-cities-in-europe-where-people-are-stuck-in-traffic-most-often/


A shop dedicated to tasty juice

2025-01-09 14:04:10

arihak

A shop dedicated to tasty juice


in the busy old town center.

2025-01-08 16:16:08

in the busy old town center.


News

2025-01-07 14:56:00

A reminder for keeping your data safe when traveling. Why? It is likely that you have to access your most critical data in risky situations on the road.https://cybernews.com/privacy/how-to-protect-your-sensitive-information-while-traveling/


News

2025-01-02 16:33:00

What about the scenery, you who are hurrying to the other side?#streetphotography#streetphoto


News

2025-01-01 16:06:00

According to a survey, third of travelers are victims of online booking scams. Since it is so convenient to make travel reservations online, that’s what we do. The problem is that we haven’t adopted new methods to avoid online scams. #travel #scamhttps://klaava.com/a-traveler-is-more-likely-to-get-scammed-when-booking-a-trip-than-being-robbed-in-a-destination/


Perhaps road builders had too much time?

2024-12-29 15:19:44

Perhaps road builders had too much time?


News

2024-12-27 18:25:00

#Photography is full of so-called “rules” that can feel overwhelming. However, some of these “rules” are downright myths.https://www.diyphotography.net/debunking-seven-common-myths-photographers-still-believe-in/


What should I read next?

2024-12-25 15:18:22

arihak

What should I read next?


News

2024-12-23 11:34:00

Since #EU #DMA has specified #Apple as a #gatekeeper in #mobile devices, EU considers Apple should implement several iOS connectivity features, predominantly used for and by connected devices. For instance, notifications, automatic Wi-Fi connection, AirPlay, AirDrop, or Bluetooth audio switching.https://digital-markets-act.ec.europa.eu/commission-seeks-feedback-measures-apple-should-take-ensure-interoperability-under-digital-markets-2024-12-19_en


News

2024-12-21 14:51:00

Smartphone users in the US are not impressed with the latest artificial intelligence features on their devices with 73 percent of Apple users and 87 percent of Samsung users unsatisfied, according to a new study. #phone #AIhttps://petapixel.com/2024/12/19/majority-of-smartphone-users-are-unimpressed-with-ai-features-study-finds/


There should be enough ice already to open the hotel

2024-12-20 16:40:17

There should be enough ice already to open the hotel


Hiking on a mountain experience: the end of an ancient tunnel

2024-12-09 14:12:31

arihak

Hiking on a mountain experience: the end of an ancient tunnel


on a hot summer day

2024-12-02 18:47:01

on a hot summer day


Cloudy day in a valley

2024-11-25 16:31:59

arihak

Cloudy day in a valley


In the shade of a lone palm tree

2024-11-25 15:46:29

In the shade of a lone palm tree


an abandoned town?

2024-11-07 18:35:22

an abandoned town?


A quiet moment between heavy rain

2024-10-24 17:34:45

A quiet moment between heavy rain