Thoughts on type-ahead search
Chad Scott 110000E1UB Visits (5083)
Installing and configuring type-ahead search is a relatively straightforward process. What may be less clear, however, is validating that it works. That's the situation I found myself in when setting it up for the first time. I like to validate everything I set up, but it wasn't clear to me how to do so for type-ahead search. What gets indexed? When is it indexed? How do I know it's actually working?
First, a bit of background information. Solr is an open source search platform that is used to implement the back end of Connections type-ahead search. It's the thing that gets installed and configured. When users access Connections content, requests are sent to Solr that contain metadata about the accessed content. This metadata includes items like the content's title and URL and the user ID of the person accessing the content. It does not include the content data itself. Solr takes this metadata and--in real time--indexes it as a document. Unlike Connections search, indexing does not occur at regular intervals.
To validate Solr index data, we can use the Solr admin UI to execute searches as Connections data is accessed. To get started, navigate to http
The main pane will allow us to execute arbitrary queries against the Solr data. Our first goal is to verify that we see documents indexed when accessing Connections content, so we'll first add last
With this set, it's time to access content in Connections. In this example, I've just accessed a community named Global Communications with a user named firstname.lastname@example.org. All I need to do on the Solr admin Query page is click the Execute Query button to see the most recently indexed documents. Solr returns a JSON object of 10 documents by default, and it will be the most recent 10 because of the sort field value we set earlier. Here's what I see as the most recent document:
Sure enough, this document describes the Global Communications community, and the user ID is the UUID for email@example.com. As I navigate to more content in Connections, subsequent queries will return additional documents that represent the visited content. Note that content is indexed by user so that the type-ahead can display results pertinent to the user executing the search. If I have another user firstname.lastname@example.org who has not visited the Global Communications community, no Solr document will exist for that community and user pairing.
Now that we've validated that Solr is indexing our Connections activity, we'll want to validate that the type-ahead search results we see match what we see when running queries via the Solr admin UI. Using the same email@example.com user, I'll access the search control in Connections and begin a type-ahead search for Global Communications.
To run an equivalent search in Solr, we'll return to the Query page. This time we'll add a query string approximating the search Connections uses.
Our results precisely match what is returned by the type-ahead search.
At this point I have validated both the index and search phases of type-ahead search and am confident that the feature is working as intended.