Anant Corporation Blog

Our research, knowledge, thoughts, and recommendations about building and leading businesses on the Internet.

Category Archives: Uncategorized


searchstax.solr.drupal.logos

How to Set Up a Drupal Website Connected to a SearchStax Deployment

Basic Steps:

  1. Create a new Deployment in SearchStax
  2. Upload a Custom Configuration to Your Solr Server
  3. Install Drupal
  4. Install Search API / Search API Solr plugin
  5. Configure the Search API Solr Plugin
  6. Add sample content
  7. Optional – Manually Index Your Site

Step 1: Create a New Deployment in SearchStax

Assuming you have already created a SearchStax account and do not already have a deployment set up, click on the Deployments tab and then click on the Add Deployment button at the top.  Enter a Deployment name, and select the most appropriate Region, Plan, and Solr Version for your needs.  In this example we will be using Solr Version 6.4.2.

Once you create your Deployment, you will see it in the Deployments dashboard.

Clicking on the arrow button on the right of the deployment will give you pertinent information about your deployment’s servers.  The Solr Load Balancer URL will bring you to your Solr server dashboard.

Step 2: Upload a Custom Configuration to Your Solr Server

Download the Search API Solr plugin files: https://www.drupal.org/project/search_api_solr

Included in the Search API Solr download are several configurations in the solr-conf folder, with subfolders 4.x, 5.x, and 6.x for the respective Solr versions.  

SearchStax uses Apache ZooKeeper for maintaining configuration information.  Upload the appropriate configuration files via Zookeeper and create a new collection.  If you have your Zookeeper script already, the two commands you will need are as follows:

 

Upload Configuration:

Linux:

zkcli.sh -zkhost <zookeeper URL> -cmd upconfig -confdir <Solr configuration> -confname <configuration name>

Windows:

zkcli.bat -zkhost <zookeeper URL> -cmd upconfig -confdir <Solr configuration> -confname <configuration name>

 

Create New Collection:

Linux:

curl ‘<Load Balancer URL>admin/collections?action=CREATE&name=<collectionName>&collection.configName=<configName>&numShards=1’

Windows:

curl.exe “<Load Balancer URL>admin/collections?action=CREATE&name=<collectionName>&collection.configName=<configName>&numShards=1” -k

 

Detailed instructions on uploading a new configuration and creating a new collection for a Solr deployment can be found here: https://www.measuredsearch.com/docs/

 

Once complete, go into your Solr dashboard. There will be a newly created core based on the name of the collection name you defined when uploading the configuration. Make note of this core name.

Step 3: Install Drupal

If you do not already have one, there are many ways to create your own Drupal instance.  Some web hosting services offer specialized integrations and setup options that help streamline the process.  Here we used GoDaddy’s Cloud Server services, which in a few clicks can create a hosted Drupal website.

Step 4: Install Search API / Search API Solr plugin

Go to your Drupal website and log in.

 

Open up a new tab in your web browser, then go to: https://www.drupal.org/project/search_api.  Once there, scroll down to find the different download links.  Right click on the appropriate Download link to the compressed file, and copy the link address.

In your Drupal site, either navigate to the /admin/modules page or click the Extend tab at the top.  Then click Install New Module.

Paste the link address copied earlier into the “Install from a URL” text field, and then click the Install button.

Once complete, you should see a confirmation message saying that the installation was complete.

If you see this, then you can install the Solr plugin for Search API:

https://www.drupal.org/project/search_api_solr.  Install this in the same way as above.

 

Before continuing, you may need to install the Search API Solr composer dependencies.  See https://www.drupal.org/documentation/install/composer-dependencies for instructions on how to do this.

 

Next, you will need to enable the installed modules.  Click “Enable newly added modules”, or click on the Extend tab.  Scroll down to the section called Search to see new module settings.

Enable the following items: Search API, Solr search, and Solr Search Defaults.

Then click Install at the bottom of the page. You should see this confirmation:

Once complete, it is recommended to uninstall the Solr Search Defaults module, as it may affect performance.  Uninstalling the module will not remove the provided configurations.

Step 5: Configure the Search API Solr Plugin

Now that the modules have been enabled, click on the Configuration tab.  Look for section “SEARCH AND METADATA” and click on Search API to configure it.  

Once there, click Add Server.

Give your server a name, make sure the Backend is set to Solr, and configure your Solr Backend.  Check that HTTP protocol is set to https, the Solr host and Solr port are correct, and you set the Solr core that was created after uploading your Solr configuration.

If your configuration settings are valid, you will see a message saying that the information was saved successfully.

Next you will need to define an Index.  In the Search API configuration screen, click on Add Index.

Give your index a name, and select the Data sources you wish to index.  For this example, select Comment and Content.  Also, at the bottom of the page make sure that you select the Server created earlier.

Step 6: Add Sample Content

 

Install the Devel plugin using the same method as described in Step 4: https://www.drupal.org/project/devel.  Then, enable Devel and Devel generate.

You will see new options in multiple menus.  Go to Manage > Configuration, and scroll down to the Development section.  Here you have options to Generate content via Devel.

Click on Generate Content.

Select a Content Type and enter the number of nodes.  For example, selecting Article and typing “20” nodes will produce 20 new articles filled with dummy data.

Step 7: Optional – Manually Index Your Site

A cron job will periodically index your site automatically, but if you want to see your results immediately go to the Search API configuration screen and click on the index created earlier.  At the bottom, click on the Index now button.

After you begin, you will see a progress bar.  Once it reaches 100%, you will get a Success message.

After your site has been indexed, you can view and query the data in Solr.

Congratulations!  You have now customized your Drupal website to allow for content to be indexed in your SearchStax Solr deployment.

Software Algebra – Building Applications Without Reinventing the Wheel

As technology has continued to mature in the last two decades there have been many challenges overcome, obstacles faced, and solutions crafted. A recurring theme, in the area of obstacles (more specifically, self-imposed obstacles), has been the propensity for software companies to more often than not 1) turn to developing applications from the ground up for a particular problem or 2) take existing pieces of software that are perfectly fine for their specific use case and then tailor them to a different (but sometimes slightly similar) use case.

 

Software Algebra is essentially a best practice in software development to make sure that we are using 1) the tools best suited to a particular problem 2) while also dodging the trap of re-inventing the wheel by starting from scratch or trying to fit a tool into solving a problem it was never intended to address.

 

There are multiple cases in which this best practice is entirely ignored, most commonly so by inexperienced software architects who have the “my hammer can solve all problems” mindset. Often times, one of the best ways to avoid falling into this trap is to relentlessly focus on getting a Minimal Viable Product (MVP) out of the door in a time-boxed span of time and iterating multiple times on that MVP to steadily bring it up to support all use cases.

 

We recently spoke about this topic at the WebTech Conference in Washington, DC and will be doing so again on Tuesday, April 11th at 6PM at the University of Maryland Baltimore County, you can find additional details as well as register for the event here.

Mastering Services in the Service of Others

You’re headed to New York and you see a yard sale. Do you stop or not?

To achieve success and accomplish a significant objective it is critical to exercise discipline and define a purpose. Today, when many of us have not defined a goal or outlined a path to reach it, the importance of this necessary focus can not be emphasized enough with the myriad distractions surrounding us.

10,000 hours. It is widely circulated that it takes this long to obtain mastery in a given field. This equates to roughly five years of focused work to master your craft.

It is rare and pleasant opportunity to meet a true expert in their field. At Anant, we believe this boils down to a breakdown in orientation, decision, and action.

Orientation is the disciplined thought that goes into molding a purpose and mission for oneself. The purpose answers the question of why you are; whereas, the mission answers what you are doing. An engine’s purpose is to power movement ; however, the mission of the engine on the Apollo 11 is vastly different from the mission of the engine on your weekend Uber.

Decision is where you choose to invest your time in order to get the best bang for your buck and this choice is informed by the output of the orientation phase.

Action is the most important aspect of this concept. Without action, all ideas are but dreams. However, you must be wary to not be busy for the sake of busyness. You need to cultivate discipline and channel it into your daily actions by making sure to address  your priorities consistently.

Having a strong road map will help you to stay on track. Segmenting your life into different categories can be of tremendous help.

Our CEO, Rahul Singh, uses the following table in order to align his professional and personal priorities.

Screen Shot 2016-03-30 at 5.04.38 PM

The following slides are from Rahul’s speech at the Washington DC chapter of the International Institute of Business Analysis. Learn how to align your professional goals with your personal goals, and find some recommended reading. 

Check out Anant’s upcoming events here and we hope to see you in New York (or at our office in DC…just not at that yard sale)!

Anant is the sponsor of DC Enterprise Tech Meetup group, we are a group of entrepreneurs embracing new tech trends, modern enterprise and web technologies. 

Event Sponsor: IIBADC Washington Business Analysts Meetup Group

This group is an outreach of the IIBADC, the Chapter of the International Institute of Business Analysis for the Washington DC Metro area. The group is an informal way for BAs to get together to discuss our craft and spread the good news about how Business Analysis can help save the world.