Blog

Coming Soon to State Decoded

Updated 8/19/2017 to fix web links

State codes are wretched. Seriously, look at a few: California’s, New York’s, Illinois’, and Texas’ are all good examples of how stunningly difficult that 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 law more accessible by the very people that are governed by the law.

State Decoded is a great resource and OSC recently completed a project that will soon make it even better! The focus of this project was to improve the State Decoded search functionality. In the remainder of this post we will describe the current status of State Decoded search, we will describe the changes coming soon, and we will describe the long term goals for State Decoded search.

Current Status: Good, but Could be Better

In an earlier post, Waldo Jaquith describes 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.

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:

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 users 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 users query. When a user clicks on a particular result, the full text of that section of the law will be highlighted with the users search terms.

Suggest-as-you Type

One of the most exciting new features will be “suggest-as-you-type”. As a user types in their search string, they will be prompted with terms that match 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

Our current work with State Decoded represents a great leap forward for the search user experience. However there is always more work to do! 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, a user 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.