#2019 Solr datatype validation

v1.0.0
closed
Wolf
sf-2 (994)
General
nobody
2015-08-20
2011-04-26
No

When saving a record to solr, fieldname_i: None will cause problems (it saves the string "None" but needs an int). We should raise an exception for those. Also look for other solr data types where similar problems could occur, and do the same.

Discussion

  • Dave Brondsema

    Dave Brondsema - 2011-04-27
    • status: open --> in-progress
    • assigned_to: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2011-04-27

    forge:db/2019 To test the big solr problem, run a paster shell and do:

    from allura.model import User
    c.user = User.anonymous()
    h.set_context('test4', 'tickets')
    from forgetracker.model import Ticket
    t = Ticket()
    assert t.ticket_num is None
    from allura.lib.search import solarize
    s = solarize(t)
    g.solr.add([s])
    

    do a search, confirm error on all ticket searches. Then fix with:

    g.solr.delete(q='project_id_s:%s' % c.project._id)
    

    Then upgrade pysolr with pip install pysolr==2.0.13 and start a new paster shell and do it again. Ticket search shouldn't give a solr error. May get a legitimate KeyError: 'ticket_num_i' if the result is in it.

    To test logging changes: run an invalid search like "foo && && || foo". You should get the solr message in the page response. allura.log should have the solr error message also. I created https://control.sog.geek.net/sog/trac/ticket/18365 to tweak the logging

     
  • Dave Brondsema

    Dave Brondsema - 2011-04-28
    • status: in-progress --> code-review
    • assigned_to: Dave Brondsema --> Wolf
     
  • Wolf - 2011-04-28

    merged directly to forge:master @ [76cf08e]

     
  • Wolf - 2011-04-28
    • status: code-review --> closed
     

Log in to post a comment.