Haystack: an IndexTank client for CodeIgniter 2.0+

IndexTank

Update: The IndexTank service is no longer in operation. They were bought by LinkedIn and have closed their API and services to all existing and new customers. However, the good folks at IndexTank have open sourced their entire platform, and several great companies have been created to continue to service IndexTank customers. They are all completely compatible with my Haystack library as well as any existing IndexTank code you have written.

Take a moment to check out these great new companies:

The IndexTank API is a hosted search solution used by some of the largest sites on the web such as Reddit, Twitvid and ZenCoder. It offers some cool features such as Geolocation, fuzzy search, autocomplete, “Did you mean” spelling correction, stemming and most importantly, real-time indexing.

It’s a pretty cool service, and did I mention that it’s free to index up to 100,000 documents?

The only problem is that there wasn’t a PHP client available for the CodeIgniter framework, until now.

Haystack is a PHP client offering basic interaction with the IndexTank API, implemented as a CodeIgniter library. It is very much a work in progress, and as I wrote it primarily for use in my current project, it is not as general as it could be. I will be maintaining the library on Github and will continue to add new functionality and improvements as time allows.

You can download the library from my Github repository.

Basic Usage

Quiltcraft Industries, Inc.

Quiltcraft Industries
Quiltcraft Industries

July 2011

The quiltcraft.com site is a marketing, portfolio and product catalog website for Dallas-based textile manufacturer Quiltcraft Industries. It features a modern, WordPress-based aesthetic, and the latest in HTML5 and CSS technologies.

Project Technologies

  • WordPress
  • PHP
  • HTML5
  • CSS3
  • jQuery/JavaScript
  • Graphic Design
  • Search Engine Optimization

View the SQL code of a Stored Procedure in SQL Server Management Studio

Microsoft SQL Server

I’m working on overhauling a large project management application for a client that I inherited from a previous developer.  Part of the application will produce various reports based on data pulled from a SQL Server database.  The query that pulls this data is a Stored Procedure in the database. Rather than try to reverse engineer the SQL query, I can simply run a SQL query of my own to dump the SQL code from the Stored Procedure so I can incorporate it into my application.

Just log into SQL Server Management Studio, open the database where the Stored Procedure resides, and execute the following query:

sp_helptext ‘dbo.stored_procedure_name_here’

Exchange 2007 Dynamic Distribution Groups with Custom Filters

Exchange 2007

Recently I was experimenting with Exchange 2007 Dynamic Distribution Groups for a client. I have the Active Directory profiles of each mailbox-enabled user filled out so that I can dynamically create and set their Outlook profiles automatically. I wanted to use some of this information that I already store about each user to create distribution groups on the fly so that I don’t have to actively maintain group membership.

Specifically, I wanted to use the Office and Description field of their Active Directory profile to include them in a distribution group. For instance, I have the following basic information stored in Active Directory for each user:

User A
Description: Dallas User
Office: Corporate Office

User B
Description: Dallas User
Office:
North Dallas Field Office

User C
Description: Houston User
Office: Houston Office

If I want to maintain distribution groups in Exchange for each geographical area as well as each individual office, that is pretty easy in Exchange 2007.  You just create a new Dynamic Distribution Group.  However, the difficulty comes when you want to use an Active Directory profile field that is not built in the Exchange Management Console GUI.

Executing the following command in the Exchange Management Shell will create a new Dynamic Distribution Group that selects every mailbox-enabled user with a Description field set to “Dallas User”:

New-DynamicDistributionGroup -Name “GroupNameHere” -OrganizationalUnit “domain.local/OUNameHere” -RecipientFilter { ((RecipientType -eq ‘UserMailbox’) -or (RecipientType -eq ‘MailContact’) -or (RecipientType -eq ‘Contact)) -and (Description -eq ‘Dallas User’) }