Skip to content

API related issue with nested facets #151

Description

@wkdewey

Queries are coming into the find_source_from_top_hits method in a formal it can't handle.

NoMethodError (undefined method `gsub' for {"race"=>["Unknown"]}:Hash

          string.gsub(/[^\x00-\x7f]/u) do |char|
                ^^^^^):

app/services/search_item_res.rb:133:in `remove_nonword_chars'
app/services/search_item_res.rb:64:in `block in find_source_from_top_hits'
app/services/search_item_res.rb:64:in `map'
app/services/search_item_res.rb:64:in `find_source_from_top_hits'
app/services/search_item_res.rb:99:in `format_bucket_value'
app/services/search_item_res.rb:115:in `block (2 levels) in reformat_facets'
app/services/search_item_res.rb:115:in `each'
app/services/search_item_res.rb:115:in `block in reformat_facets'
app/services/search_item_res.rb:111:in `each'
app/services/search_item_res.rb:111:in `reformat_facets'
app/services/search_item_res.rb:20:in `build_response'
app/services/search_service.rb:124:in `build_item_response'
app/services/search_service.rb:77:in `search_items'
app/controllers/item_controller.rb:10:in `index'
Started GET "/collections/petitioning-for-freedom/items?num=50&sort[]=title%7Casc&facet_limit=100&facet_sort=count%7Cdesc&browse_sort=term%7Casc&hl_fl=annotations_text%2C+transcription_t%2C+text&hl_num=5&facet[]=category&facet[]=keywords3&facet[]=category2&facet[]=%5B%22event.product%5Bevent.type%23outcome%5D%22%2C+%22outcome%22%5D&facet[]=%5B%22event.product%5Bevent.type%23fate_of_bound_partys%5D%22%2C+%22fate_of_bound_party%22%5D&facet[]=date.year&facet[]=date_not_before.year&facet[]=date_not_after.year&facet[]=%5B%22spatial.name%5Bspatial.type%23court_location%5D%22%2C+%22court_name%22%5D&facet[]=rights_holder&facet[]=type&facet[]=extent&facet[]=event.factor&facet[]=keywords2&facet[]=person.sex&facet[]=%5B%22person.race%5Bperson.role%23person%5D%22%2C+%22person%22%5D&facet[]=person.nationality&facet[]=person.age_category&facet[]=%5B%22rdf.predicate%5Brdf.type%23person_relationship%5D%22%2C+%22person_relationships%22%5D&facet[]=has_relation.title&q=category%3A%28NOT+Documents%29&start=0" for 127.0.0.1 at 2024-12-16 11:28:01 -0600

Activity

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions