Skip to content

Handle editions within Solr #500

Closed
Closed

Description

@waldoj

At present, Solr is never cleared out. Each new edition just adds more data to it. This might result in having multiple copies of each law show up in search results, or it might overwrite existing records (I'm not sure which). Overwriting existing records might sound OK, but if § 1-2.34-56 is removed from a new edition of the code, it will stay in the index, resulting in people being shown no-longer-extant laws as if they're still on the books.

Realistically, there are three steps to this:

  1. Clear out Solr at the same time as clearing out everything else in the database.
  2. Establish a field and facet for editions within Solr (which I don't think exists now).
  3. Clear out just the edition in question from Solr, rather than everything, when updating an edition.

I'm OK with only doing the first step for v1.0, and saving 2 and 3 for v1.1.

Activity

  1. waldoj commented on Nov 8, 2013

    @waldoj
    MemberAuthor

    @krues8dr provides this code, to this end:

    curl http://localhost:8983/solr/statedecoded/update -H "Content-type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
    curl http://localhost:8983/solr/statedecoded/update -H "Content-type: text/xml" --data-binary '<commit />'
    curl http://localhost:8983/solr/statedecoded/update -H "Content-type: text/xml" --data-binary '<optimize />'
    curl http://localhost:8983/solr/statedecoded/update -H "Content-type: text/xml" --data-binary '<commit />'
    
  2. krusynth commented on Nov 12, 2013

    @krusynth
    Member

    Here's what needs to happen, precisely:

    • Update the solr schema to add an edition field
    • Create an option on search for "search all editions", which defaults to "off". I assume we want to make search only search the edition marked as "current" by default
    • Add a delete index function to ParserController using the code above. Delete indexes matching a given edition on update/insert.

    If we end up using standard updates in solr, the primary key should now be the url, which takes into account editions and should be ok for us to use.

  3. waldoj commented on Nov 13, 2013

    @waldoj
    MemberAuthor

    Yup, this all makes sense to me.

  4. krusynth commented on Nov 15, 2013

    @krusynth
    Member

    All that mess there does is abstract out the solr curl mess into a single handler, and clear out the solr index when clearing out the database.

  5. waldoj commented on Nov 15, 2013

    @waldoj
    MemberAuthor

    Oh, great—those are sensible improvements. Thanks.

  6. krusynth commented on Feb 11, 2014

    @krusynth
    Member

    @waldoj I'm finally digging in on this. Note that a Solr schema change will be coming down the pipe soon, meaning you'll have to muck about with Solr. :suspect:

  7. krusynth commented on Feb 11, 2014

    @krusynth
    Member

    This... this may warrant a change to the SD XML format as well. 🍆

  8. waldoj commented on Feb 11, 2014

    @waldoj
    MemberAuthor

    😢

  9. krusynth commented on Feb 11, 2014

    @krusynth
    Member

    It just seems like it'd make sense to have a separate edition parameter, rather than extracting it from the unique identifier? 🎷

  10. 21 remaining items

  11. krusynth commented on Apr 13, 2015

    @krusynth
    Member

    There's a regression in this somewhere that broke highlighting, section numbers, and the structure hierarchy in results.

  12. krusynth commented on Apr 19, 2015

    @krusynth
    Member

    This is getting pretty close. I still need to get the frontend search form working with the backend changes I've made here - particularly in handling the edition id that's passed now, but otherwise editions are pretty much working with Solr. The schema has changed a lot though, everything will need to be reindexed.

  13. krusynth commented on Apr 25, 2015

    @krusynth
    Member

    This is now complete on the edition-update branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions