Opensolr Basic User Guide with Integrations
Overview
Opensolr provides a fully managed Apache Solr hosting service that allows you to create and manage search indexes, connect external websites (Drupal, WordPress, or custom-built), and use Solr Search APIs easily without managing your own servers.
1. Getting Started
Create an Account
- Go to https://opensolr.com.
- Click Sign Up and create your account.
- Confirm your email and log in to the Opensolr Control Panel.
Access the Control Panel
- After logging in, you’ll be directed to the Dashboard.
- Here, you can manage Solr indexes, configurations, API keys, and user access.
2. Creating a Solr index
- In your dashboard, click New index.
- Choose the Solr version that matches your application (e.g., 8.x or 9.x).
- Give your index a name (e.g.,
drupal_search
, wordpress_search
, or custom_site
).
- Click Create.
- Wait a few seconds for the index to initialize. Once ready, you’ll see connection details like:
- Solr Core URL
- Hostname and Port
- index name
- Authentication credentials (if enabled)
3. Connecting Drupal to Opensolr
Install Required Modules
- In your Drupal admin panel, install:
- Enable both modules.
Configure the Search Server
- Go to Configuration → Search and Metadata → Search API.
- Click Add Server.
- Fill in the following:
- Name: Opensolr Search
- Backend: Solr
- Solr Host: Provided by Opensolr (e.g.,
server-name.opensolr.com
)
- Save the server and test the connection — it should say “The Solr server could be reached successfully.”
Add an Index
- Under Search API, click Add Index.
- Choose your content types (e.g., Articles, Pages).
- Assign your newly created Opensolr server to the index.
- Save and index your content.
Your Drupal site is now powered by Opensolr.
4. Connecting WordPress to Opensolr
Install a Plugin
- From the WordPress dashboard, go to Plugins → Add New.
- Search for “Search with Solr” or “WPSOLR”.
- Install and activate the plugin.
Configure Plugin Settings
- Navigate to Settings → Solr Search.
- Fill in your Opensolr connection details:
- Solr Host: e.g.,
https://yourdomain.opensolr.com/solr/wordpress_search
- Port: 443 (for HTTPS)
- Path:
/solr/wordpress_search
- Save settings and reindex your site content.
Your WordPress search now uses Opensolr for fast and accurate results.
5. Integrating a Custom Website via Search API
If you have a custom PHP, Python, or Node.js website, you can interact directly with Opensolr’s Search API.
Example using cURL
curl "https://yourdomain.opensolr.com/solr/custom_site/select?q=example&rows=5&wt=json"
Example using PHP
<?php
$url = "https://yourdomain.opensolr.com/solr/custom_site/select?q=example&wt=json";
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);
?>
Example using JavaScript (Fetch API)
fetch("https://yourdomain.opensolr.com/solr/custom_site/select?q=example&wt=json")
.then(res => res.json())
.then(data => console.log(data));
6. Testing Your Integration
- Index some test data or publish content.
- Run a search from your website.
- Verify that results match your Opensolr index.
7. Troubleshooting
Issue |
Possible Cause |
Solution |
Cannot connect to Solr |
Wrong hostname or index name |
Verify your Opensolr connection URL |
No search results |
Schema mismatch or unindexed data |
Reindex your content or update schema |
Plugin error in Drupal/WordPress |
Version incompatibility |
Update Solr module/plugin to latest version |
8. Resources