From 54cc39f166704720c6f42b163609b004c4a3d8ed Mon Sep 17 00:00:00 2001 From: Raju Jha Date: Mon, 26 Mar 2018 17:27:34 +0530 Subject: [PATCH 1/5] written guide for elasticsearch --- docs/guides/run-elasticsearch.rst | 84 +++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 docs/guides/run-elasticsearch.rst diff --git a/docs/guides/run-elasticsearch.rst b/docs/guides/run-elasticsearch.rst new file mode 100644 index 00000000000..64e0ce67621 --- /dev/null +++ b/docs/guides/run-elasticsearch.rst @@ -0,0 +1,84 @@ +Enabling Elasticsearch on the local server +========================================== + +Read the Docs has been using Elasticsearch which is a platform for distributed search and analysis of data in real time. To enable the search feature on your local installation, you need to install the elasticsearch locally and run the Elastic server. + +Installation has been mainly divided into following steps. + +1. Installing Java +------------------ + +First, you need to a Java Runtime Environment (JRE) because Elasticsearch is written in the Java programming lanaguage and requires Java 7 or higher. + +Installing OpenJDK 8:: + + (READTHEDOCS)$ sudo add-apt-repository ppa:openjdk-r/ppa + (READTHEDOCS)$ sudo apt-get update + (READTHEDOCS)$ sudo apt-get install openjdk-8-jre + +To verify the installation,:: + + (READTHEDOCS)$ java -version + +The result should be something like this:: + + openjdk version "1.8.0_151" + OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12) + OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode) + + +2. Downloading and installing Elasticsearch +------------------------------------------- + +Elasticsearch can be downloaded directly from elastic.co in zip, tar.gz, deb, or rpm packages. For Ubuntu, it's best to use the deb (Debian) package which will install everything you need to run Elasticsearch. + +RTD currently uses elasticsearch 1.x which can be easily downloaded and installed from the official website (http://elastic.co). + +Download it in a directory parallel to where the readthedocs.org project has been stored.:: + + (READTHEDOCS)$ wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.3.8.tar.gz + (READTHEDOCS)$ tar -xzf elasticsearch-1.3.8.tar.gz + (READTHEDOCS)$ cd elasticsearch-1.3.8 + +Your directory structure after the above command would be: + +READTHEDOCS + |- readthedocs.org + |- elasticsearch-1.3.8 + +3. Running Elasticsearch from command line +------------------------------------------ + +Goto elasticsearch home directory.:: + + (READTHEDOCS/elasticsearch-1.3.8)$ cd elasticsearch-1.3.8/bin/ + (READTHEDOCS/elasticsearch-1.3.8/bin)$ ./elasticsearch + +To verify run:: + + (READTHEDOCS/elasticsearch-1.3.8/bin)$ curl http://localhost:9200 + +You should get something like: + +``{ + status: 200, + name: "Amina Synge", + version: { + number: "1.3.8", + build_hash: "475733ee0837fba18c00c3ee76cd49a08755550c", + build_timestamp: "2015-02-11T14:45:42Z", + build_snapshot: false, + lucene_version: "4.9" + }, + tagline: "You Know, for Search" +} +`` + +4. Index the data available at RTD database +------------------------------------------- + +In order to search through the RTD database, you need to index it into the elasticsearch index.:: + + (READTHEDOCS/readthedocs.org)$ python manage.py reindex_elasticsearch + +You are ready to go! From 84aea29b6d7fe63c255922c584adc9dd63bdabd9 Mon Sep 17 00:00:00 2001 From: Raju Jha Date: Tue, 27 Mar 2018 14:57:20 +0530 Subject: [PATCH 2/5] added links for installation of JDK --- docs/guides/run-elasticsearch.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/guides/run-elasticsearch.rst b/docs/guides/run-elasticsearch.rst index 64e0ce67621..fb3145a5ae5 100644 --- a/docs/guides/run-elasticsearch.rst +++ b/docs/guides/run-elasticsearch.rst @@ -1,3 +1,4 @@ +========================================== Enabling Elasticsearch on the local server ========================================== From 53f4124693e4e60bc64440bfbfc8fd2d53e710a9 Mon Sep 17 00:00:00 2001 From: Raju Jha Date: Tue, 27 Mar 2018 15:00:34 +0530 Subject: [PATCH 3/5] updated official links for JDK --- docs/guides/run-elasticsearch.rst | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/guides/run-elasticsearch.rst b/docs/guides/run-elasticsearch.rst index fb3145a5ae5..b43945e2e1a 100644 --- a/docs/guides/run-elasticsearch.rst +++ b/docs/guides/run-elasticsearch.rst @@ -9,15 +9,9 @@ Installation has been mainly divided into following steps. 1. Installing Java ------------------ -First, you need to a Java Runtime Environment (JRE) because Elasticsearch is written in the Java programming lanaguage and requires Java 7 or higher. +Elasticsearch requires JAVA 8 or later. Use .. _Oracle official documentation:http://www.oracle.com/technetwork/java/javase/downloads/index.html or opensource distribution like .. _OpenJDK:http://openjdk.java.net/install/ -Installing OpenJDK 8:: - - (READTHEDOCS)$ sudo add-apt-repository ppa:openjdk-r/ppa - (READTHEDOCS)$ sudo apt-get update - (READTHEDOCS)$ sudo apt-get install openjdk-8-jre - -To verify the installation,:: +After installing java, verify the installation by,:: (READTHEDOCS)$ java -version From ca6bcd1ad14992d06402d4ab8bea53e8368ccaa7 Mon Sep 17 00:00:00 2001 From: Raju Jha Date: Tue, 27 Mar 2018 16:52:24 +0530 Subject: [PATCH 4/5] corrected typo in features.rst --- docs/features.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features.rst b/docs/features.rst index 5d3fd2358c4..f0ceb1336be 100644 --- a/docs/features.rst +++ b/docs/features.rst @@ -60,7 +60,7 @@ When you build your project on RTD, we automatically build a PDF of your project Search ------ -We provide full-text search across all of the pages of documentation hosted on our site. This uses the excellent Haystack project and Solr as the search backend. We hope to be integrating this into the site more fully in the future. +We provide full-text search across all of the pages of documentation hosted on our site. This uses the excellent Haystack project and Elasticsearch as the search backend. We hope to be integrating this into the site more fully in the future. Alternate Domains ----------------- From f10e7459e4c76f4c478cf61342c9cb4ea0f97cd2 Mon Sep 17 00:00:00 2001 From: Raju Jha Date: Tue, 27 Mar 2018 16:55:37 +0530 Subject: [PATCH 5/5] deleted unintended file --- docs/guides/run-elasticsearch.rst | 79 ------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 docs/guides/run-elasticsearch.rst diff --git a/docs/guides/run-elasticsearch.rst b/docs/guides/run-elasticsearch.rst deleted file mode 100644 index b43945e2e1a..00000000000 --- a/docs/guides/run-elasticsearch.rst +++ /dev/null @@ -1,79 +0,0 @@ -========================================== -Enabling Elasticsearch on the local server -========================================== - -Read the Docs has been using Elasticsearch which is a platform for distributed search and analysis of data in real time. To enable the search feature on your local installation, you need to install the elasticsearch locally and run the Elastic server. - -Installation has been mainly divided into following steps. - -1. Installing Java ------------------- - -Elasticsearch requires JAVA 8 or later. Use .. _Oracle official documentation:http://www.oracle.com/technetwork/java/javase/downloads/index.html or opensource distribution like .. _OpenJDK:http://openjdk.java.net/install/ - -After installing java, verify the installation by,:: - - (READTHEDOCS)$ java -version - -The result should be something like this:: - - openjdk version "1.8.0_151" - OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12) - OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode) - - -2. Downloading and installing Elasticsearch -------------------------------------------- - -Elasticsearch can be downloaded directly from elastic.co in zip, tar.gz, deb, or rpm packages. For Ubuntu, it's best to use the deb (Debian) package which will install everything you need to run Elasticsearch. - -RTD currently uses elasticsearch 1.x which can be easily downloaded and installed from the official website (http://elastic.co). - -Download it in a directory parallel to where the readthedocs.org project has been stored.:: - - (READTHEDOCS)$ wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.3.8.tar.gz - (READTHEDOCS)$ tar -xzf elasticsearch-1.3.8.tar.gz - (READTHEDOCS)$ cd elasticsearch-1.3.8 - -Your directory structure after the above command would be: - -READTHEDOCS - |- readthedocs.org - |- elasticsearch-1.3.8 - -3. Running Elasticsearch from command line ------------------------------------------- - -Goto elasticsearch home directory.:: - - (READTHEDOCS/elasticsearch-1.3.8)$ cd elasticsearch-1.3.8/bin/ - (READTHEDOCS/elasticsearch-1.3.8/bin)$ ./elasticsearch - -To verify run:: - - (READTHEDOCS/elasticsearch-1.3.8/bin)$ curl http://localhost:9200 - -You should get something like: - -``{ - status: 200, - name: "Amina Synge", - version: { - number: "1.3.8", - build_hash: "475733ee0837fba18c00c3ee76cd49a08755550c", - build_timestamp: "2015-02-11T14:45:42Z", - build_snapshot: false, - lucene_version: "4.9" - }, - tagline: "You Know, for Search" -} -`` - -4. Index the data available at RTD database -------------------------------------------- - -In order to search through the RTD database, you need to index it into the elasticsearch index.:: - - (READTHEDOCS/readthedocs.org)$ python manage.py reindex_elasticsearch - -You are ready to go!