Jump to content

Setup ElasticSearch with Elastic.co


NZyan
 Share

Go to solution Solved by Daniel F,

Recommended Posts

I have to switch my Elasticsearch provider, so I decided to give elastic.co a try.

I have:

  • Endpoint
  • User
  • Password
  • Private API Key
  • Public Search Key

What exactly do I have to enter in the IPB admin dashboard?

username:password@endpoint didn't work – resulting in an error message:

Quote

The server did not return the expected response. Check Elasticsearch is properly installed and accessible from your web server. If you visit the provided URL in your browser you should see details about the installed version.

 

Any suggestions?

Andreas

Link to comment
Share on other sites

Tried it, didn't work.

Does Elastic.co need Private API key or Public Search key in order to work?

They provided a sample API call – which worked when I sent it from the shell:

curl -X POST 'https://[ENDPOINT]/api/as/v1/engines/[INDEXNAME]/documents' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer private-[KEY]' \
  -d '[
        {
          "id": "park_rocky-mountain",
          "title": "Rocky Mountain",
          "description": "Bisected north to south by the Continental Divide, this portion of the Rockies has ecosystems varying from over 150 riparian lakes to montane and subalpine forests to treeless alpine tundra. Wildlife including mule deer, bighorn sheep, black bears, and cougars inhabit its igneous mountains and glacial valleys. Longs Peak, a classic Colorado fourteener, and the scenic Bear Lake are popular destinations, as well as the historic Trail Ridge Road, which reaches an elevation of more than 12,000 feet (3,700 m).",
          "nps_link": "https://www.nps.gov/romo/index.htm",
          "states": [
            "Colorado"
          ],
          "visitors": 4517585,
          "world_heritage_site": false,
          "location": "40.4,-105.58",
          "acres": 265795.2,
          "square_km": 1075.6,
          "date_established": "1915-01-26T06:00:00Z"
        },
        {
          "id": "park_saguaro",
          "title": "Saguaro",
          "description": "Split into the separate Rincon Mountain and Tucson Mountain districts, this park is evidence that the dry Sonoran Desert is still home to a great variety of life spanning six biotic communities. Beyond the namesake giant saguaro cacti, there are barrel cacti, chollas, and prickly pears, as well as lesser long-nosed bats, spotted owls, and javelinas.",
          "nps_link": "https://www.nps.gov/sagu/index.htm",
          "states": [
            "Arizona"
          ],
          "visitors": 820426,
          "world_heritage_site": false,
          "location": "32.25,-110.5",
          "acres": 91715.72,
          "square_km": 371.2,
          "date_established": "1994-10-14T05:00:00Z"
        }
      ]'

 

Link to comment
Share on other sites

No, it's not needed.Here's what I'm using and which is working just fine:

1. As domain use the endpoint which you got from them.
2. constants.php needed 2 new constants:

define('ELASTICSEARCH_USER' ,"elastic");
define(	'ELASTICSEARCH_PASSWORD' , YOURPASSWORD);

where YOURPASSWORD is the one which you got while setup up everything ( you can reset it in the security section if you want an unique one for the elastic user)

CleanShot 2021-12-21 at 10.37.40@2x.png

 

Link to comment
Share on other sites

  • Solution
36 minutes ago, NZyan said:

Tried it, didn't work.

Does Elastic.co need Private API key or Public Search key in order to work?

They provided a sample API call – which worked when I sent it from the shell:

curl -X POST 'https://[ENDPOINT]/api/as/v1/engines/[INDEXNAME]/documents' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer private-[KEY]' \
  -d '[
        {
          "id": "park_rocky-mountain",
          "title": "Rocky Mountain",
          "description": "Bisected north to south by the Continental Divide, this portion of the Rockies has ecosystems varying from over 150 riparian lakes to montane and subalpine forests to treeless alpine tundra. Wildlife including mule deer, bighorn sheep, black bears, and cougars inhabit its igneous mountains and glacial valleys. Longs Peak, a classic Colorado fourteener, and the scenic Bear Lake are popular destinations, as well as the historic Trail Ridge Road, which reaches an elevation of more than 12,000 feet (3,700 m).",
          "nps_link": "https://www.nps.gov/romo/index.htm",
          "states": [
            "Colorado"
          ],
          "visitors": 4517585,
          "world_heritage_site": false,
          "location": "40.4,-105.58",
          "acres": 265795.2,
          "square_km": 1075.6,
          "date_established": "1915-01-26T06:00:00Z"
        },
        {
          "id": "park_saguaro",
          "title": "Saguaro",
          "description": "Split into the separate Rincon Mountain and Tucson Mountain districts, this park is evidence that the dry Sonoran Desert is still home to a great variety of life spanning six biotic communities. Beyond the namesake giant saguaro cacti, there are barrel cacti, chollas, and prickly pears, as well as lesser long-nosed bats, spotted owls, and javelinas.",
          "nps_link": "https://www.nps.gov/sagu/index.htm",
          "states": [
            "Arizona"
          ],
          "visitors": 820426,
          "world_heritage_site": false,
          "location": "32.25,-110.5",
          "acres": 91715.72,
          "square_km": 371.2,
          "date_established": "1994-10-14T05:00:00Z"
        }
      ]'

 

That's their documents api  https://www.elastic.co/guide/en/app-search/current/documents.html for their app search service, which is something else!

IPS is utilising their Elastic REST API which works as explained in https://invisioncommunity.com/forums/topic/464712-setup-elasticsearch-with-elasticco/?do=findComment&comment=2875516

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...