State codes are wretched. Seriously, look at a few from: CaliforniaNew YorkIllinois, and Texas. They are all good examples of how stunningly difficult it is to understand state laws. They don’t have APIs. Virtually none have bulk downloads. You’re stuck with their crude offerings.

The State Decoded is a platform that displays state codes, court decisions, and information from legislative tracking services to make it all more understandable to normal humans. With beautiful typography, embedded definitions of legal terms, and a robust API, State Decoded aims to make laws more accessible to the very people who are governed by the law. It was a winner of the 2011 John S. and James L. Knight News Challenge, which provided $165,000 to fund its development.

State Decoded is a great resource, and OpenSource Connections recently completed a project that will soon make it even better. The focus of this project was to improve the State Decoded search functionality. The following details the current status of State Decoded search, the changes coming soon, and the long-term goals for State Decoded search.

Current Status: Good, But Could Be Better

In an earlier post, Waldo Jaquith described our initial work with State Decoded. In that project, OSC equipped State Decoded with basic search features using the Solr search technology. Among other things, we gave Stated Decoded users the ability to search the text of laws and of legal definitions, to find related laws, and to filter the results according to the types of documents that they are seeking.

However, after completing this initial project, State Decoded still lacked some of the polished features available through Solr. For example in the current implementation:

  • Keyword highlighting is only present in the search results; there is no highlighting in the text of the laws or legal definitions.
  • Tag clouds and facet displays are present but are disorganized and are therefore not very helpful.
  • There is no suggest-as-you-type functionality to help the users as they search.

Coming Soon To State Decoded!

In the recently completed project, OSC has built several new search futures that will greatly aide State Decoded users as they search through laws. Our contributions can be found in this Github code repository, which will soon be added back to the original code base.

Improved Faceting

Facets are collectively the lists of menus commonly found on search pages that help users filter through search results. For instance, if you search for “running shoes” on Amazon then on the side of the page, there are several facets that allow you to filter through results based upon color, brand, and price.

Here is a screen capture of the current facets as seen in the current version of Stated Decoded.

State Decoded Facets, Old

As you can see, these facets are functional in that you can use them to filter through search results. However they are not very informative: The formatting is inconsistent; there is no information about exactly how many documents are remain in each category; and the tag clouds are disorganized and difficult to read.

Here is an example of what Stated Decoded facets may look like in the near future:

State Decoded Facets, New

There are several things to point out here. For one, the facets are all now consistently formatted as clickable hyperlinks. Also, all items in the facets are associated with a document count so that the user gets a more intuitive understanding of which areas of law are pertinent to their search. Finally, the “title” facets are presented in a hierarchical fashion preserving the structure of the law.

Law Search By Section Number

Commonly, State Decoded users will search for specific laws by typing in their section number (e.g. 13.1). Soon, State Decoded will detect when users are searching for a law by section number and will provide the appropriate results. Obviously, at the top of the result list will be that specific law (e.g. 13.1), but this will be followed by subsections (e.g. 13.1-6) and higher-level sections (e.g. 13). The results will also include laws that refer to the section specified in the user’s query.

Highlighting

Soon, State Decoded will make much more use of highlighting. On the search results page, results will include highlighted snippets of text that match the user’s query. When a user clicks on a particular result, the full text of that section of the law will be highlighted with the user’s search terms.

Suggest-As-You Type

One of the most exciting new features will be “suggest-as-you-type.” As users type in their search string, they will be prompted with terms that match laws and legal definitions in the search index. This should make it much easier for users to find to information they are searching for.

An Even Brighter Future

If we have an opportunity to work with State Decoded in the future, one of the main goals will be to tackle the fact that legal code was written using a jargon that is sometimes difficult to understand for the lay person. As a simple example, users may search using terms that they are familiar with, such as “car license,” however the laws that are most relevant to this search may only refer “motor vehicle licenses.” In the future, this problem can be addressed through the use of rich synonyms for legal jargon. Our current work with State Decoded represents a great leap forward for the search user experience. However, there is always more work to do!

John Berryman is dedicated to software development at OpenSource Connections with a focus on enterprise search and search UI/UX.