Search with a quoted phrase plus other words returns the whole catalog
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
Direzione di ricerca
L’issue indica app/search/queries/registry.py e menziona parse_search_query, build_base_query e gli unit test da aggiungere. Leggi prima build_base_query e i test di query esistenti. Il lavoro è completato quando le ricerche con una frase e una parola, e quelle con due frasi, richiedono che corrispondano tutti i termini, mentre una frase senza corrispondenze non restituisce risultati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A catalog search that combines a quoted phrase with plain words, without OR, ignores the search and returns the whole catalog sorted by popularity.
- Environment: prod catalog.data.gov
- Component: datagov-catalog search,
app/search/queries/registry.py
How to reproduce
- Search https://catalog.data.gov/search?q=%22baby%20names%22%20california
- Compare with https://catalog.data.gov/search?q=%22baby%20names%22
- Try a phrase that matches nothing: https://catalog.data.gov/search?q=%22zzzqqq%20nomatch%22%20california
Expected behavior
- Results must contain the phrase "baby names" and the word "california".
- A phrase that matches nothing returns no results.
Actual behavior
- The first and third searches both return the whole catalog, starting with "Electric Vehicle Population Data".
parse_search_queryreturns two terms withhas_orfalse.build_base_queryonly handles one term in that case and otherwise falls back to{"match_all": {}}. The comment there says "Shouldn't happen, but fall back to match_all".
Sketch
- When there's more than one term and no OR, combine them with a
boolmust, so every phrase and word has to match - Add unit tests for a phrase plus a word, and for two phrases without OR
- Lingua principale
- Python
- Stelle
- 1.2k
- Fork
- 207
- Merge medio
- 3g 16h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GSA/data.gov
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Harvester
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
-
blocked form submission shows home pageForse già presa @FuhuXia l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
idle-in-transaction for harvest record selectionForse già presa @theyottaboy l’ha presa 13 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Harvester pagination: add page-number navigation to paginationForse già presa @jaredb96 l’ha presa 23 giorni fa. Apertabug Harvester
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Tutte le issue di GSA/data.gov
Issue simili
-
Public benchmark import end-to-end test fails when the test stack's worker runs the parity jobApertaaccepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
future-agi/future-agi#6392 ·
I maintainer di solito rispondono entro 1 giorno
-
memmapped_arange ignores the start value and drops the last point above the memmap thresholdForse già presa @prathameshfuke l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
StingraySoftware/HENDRICS#213 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno