internetarchive / internetarchive/openlibrary

Edition search returning non-matches if a different edition from the same work satisfies criteria

Open
#12,052 2 comments 0 reactions 0 assignees View on GitHub
Lead: @cdrini Module: Solr Needs: Breakdown Needs: Response Priority: 4 Theme: Search Type: Bug
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

### Problem

This search https://openlibrary.org/search?q=language%3Afao+publish_place%3Atehran&mode=everything
from https://github.com/internetarchive/openlibrary/issues/9370#issuecomment-2142815320 is designed to search for miscataloged books which have the Faroese language code instead of the one for Farsi and which were published in Tehran.

This search should return zero results, but currently returns the Faroese [edition](https://openlibrary.org/books/OL911549M) of Le Petit Prince, which was published in Fuglafjørður, not Tehran.

I speculate that there's the publication place from the [Persian edition](https://openlibrary.org/books/OL23033440M) is somehow getting conflated with the language code for the Faroese edition in the search.

Low priority, but could become more of an issue as users attempt to do more sophisticated search (or they are used for internal purposes).

A related search which shows similar issues: https://openlibrary.org/search?q=language%3Afao+publish_place%3Atihran&mode=everything

### Reproducing the bug

1. Go to https://openlibrary.org/search?q=language%3Afao+publish_place%3Atehran&mode=everything

* Expected behavior: Only editions which match all criteria are returned
* Actual behavior: Works which have different editions which match some of the criteria are returned

### Context

- Browser (Chrome, Safari, Firefox, etc):
- OS (Windows, Mac, etc):
- Logged in (Y/N):
- Environment (prod, dev, local): prod

### Breakdown

Implementation Details (for maintainers)

#### Requirements Checklist
* [ ]

#### Related files

*

#### Stakeholders

*


#### Instructions for Contributors

- Please [run these commands](https://github.com/internetarchive/openlibrary/wiki/Git-Cheat-Sheet#working-on-your-branch) to ensure your repository is up to date **before** [creating a new branch](https://github.com/internetarchive/openlibrary/wiki/Git-Cheat-Sheet#making-changes-and-creating-a-pull-request) to work on this issue and **each time after** pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two linked search URLs and compare the returned editions with their language and publication-place data. Trace how work-level results combine edition criteria; done means a search returns only editions that satisfy every criterion on the same edition, with the Faroese/Fuglafjørður example excluded.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.