-
Notifications
You must be signed in to change notification settings - Fork 34
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
Language Filter with Advanced Search #116
Comments
@jduss4 Thanks for submitting this! I agree this is confusing. It seems like we should be able to filter the results from solr based on if the page has any OCR text associated with the select language. Unfortunately there is a existing bug in the upstream library that prevents this from being merged in at this time. It is being tracked here: search5/solrpy#45 |
upon further research the correct way to do this would be to add new fields to SOLR, one for each language as a boolean and mark when that page contains that language. |
@johnscancella have you considered a multivalued field that could hold any languages used per page such as |
@jduss4 I haven't, but only because I am not very familiar with SOLR. After much tracing the problem is you can't use a |
@johnscancella that makes sense, my solution would also require a reindex, or at least an update script of some sort! |
Hi All, Now I have my little corpus of Italian language newspapers. I hope this helps! Lorella. |
While implementing chronam for the University of Nebraska-Lincoln's newspapers project, which involves several Czech language papers, we discovered that selecting a language on the advanced search page does not filter by language unless if you also put in a keyword.
For example, the following query on the main chronicling america site has no parameters except for "Spanish" as the language, yet it returns nearly 9,500,000 results (presumably the entire set of OCR). This is also true if you select French, German, or English without any andtext / ortext / phrasetext, etc.
http://chroniclingamerica.loc.gov/search/pages/results/?dateFilterType=yearRange&date1=1836&date2=1922&language=spa&ortext=&andtext=&phrasetext=&proxtext=&proxdistance=5&rows=20&searchType=advanced
This seems unintuitive to us, as it is very possible that users will want to browse Czech pages rather than searching for a specific phrase. A quick fix is to include q or fq=language:Czech in the query, which hopefully should not interfere with the keyword queries which use the selected language to search ocr_eng vs ocr_cze, etc.
I've added some quick code which uses the requested code ("cze") to find a language that the solr results will recognize ("Czech") and append a language query filter.
https://gist.github.com/jduss4/d4f71929fbcf946d1c64
This is the location in the current chronam repo where we have made the changes to our project:
https://github.com/CDRH/nebnews/blob/4ea06e3c3b4ed2e23e3119454493572d6c30604d/core/index.py#L453
The language filtering only for keyword searches may be expected behavior in chronam, but I wanted to make an issue of it as it surprised us and seems unintuitive. If it is expected behavior, then perhaps a change in the UI may make it more clear how the language dropdown is going to affect search results.
The text was updated successfully, but these errors were encountered: