Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API related issue with nested facets #151

Open
wkdewey opened this issue Dec 16, 2024 · 2 comments
Open

API related issue with nested facets #151

wkdewey opened this issue Dec 16, 2024 · 2 comments
Assignees
Labels

Comments

@wkdewey
Copy link
Contributor

wkdewey commented Dec 16, 2024

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
@wkdewey wkdewey added the bug label Dec 16, 2024
@wkdewey wkdewey self-assigned this Dec 16, 2024
@wkdewey
Copy link
Contributor Author

wkdewey commented Dec 16, 2024

Introduced by 1239fac

wkdewey added a commit that referenced this issue Dec 16, 2024
@wkdewey
Copy link
Contributor Author

wkdewey commented Dec 16, 2024

The problem was that it was trying to match up hash values instead of strings in a certain instance with nested bucket aggregations. find_source_from_top_hits may need to be revised for more possibilities

wkdewey added a commit that referenced this issue Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant