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

Problema na exibição do resultado de busca | Problem displaying search result #56

Open
trevineju opened this issue Jun 9, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@trevineju
Copy link
Member

trevineju commented Jun 9, 2022

Português

Ao testar o modelo de busca com prefixo da simple query string query reparei que a API nem sempre devolve excertos do trecho buscado.

Exemplo:
buscando pela aparição da string demo* (democracia, democrático, demonstração, demonstrativo, etc) no mês de Maio em todos os municípios, a API encontra 350 resultados.
URL da requisição: https://queridodiario.ok.org.br/api/gazettes?since=2022-05-01&until=2022-05-31&querystring=demo%2A&excerpt_size=500&number_of_excerpts=1&pre_tags=&post_tags=&size=10&sort_by=relevance

A imagem exibe dois dos resultados, um deles sem excerto (o primeiro) e o outro com excerto (o segundo)
image

Acredito que seja um problema apenas de exibição, já que o resultado da busca está aparentemente certo: o diário de Manaus que aparece na imagem, realmente tem ocorrências do prefixo demo em seu conteúdo. Verifiquei outros 10 diários de municípios diferentes que também não tinha o excerto sendo exibido e também eram resultados corretos de busca (tinham o prefixo no texto)

English

When testing the prefix query of [simple query string query] (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html# simple-query-string-syntax) I noticed that the API doesn't always return excerpts from gazette searched.

Example:
Looking for the appearance of the string demo* (democracy, democratic, demonstration, demonstrative, etc) in the month of May in all municipalities, the API finds 350 results.
Request URL: https://queridodiario.ok.org.br/api/gazettes?since=2022-05-01&until=2022-05-31&querystring=demo%2A&excerpt_size=500&number_of_excerpts=1&pre_tags=&post_tags=&size=10&sort_by=relevance

The image displays two of those results, one without an excerpt (the first) and the other with an excerpt (the second)
image

I believe it is just a display problem, since the search result is apparently correct: the Manaus gazette that appears in the image actually has occurrences of the prefix demo in its content. I checked another 10 gazettes from different municipalities that also did not have the excerpt being displayed and were also correct search results (they had the prefix in the text)

@trevineju
Copy link
Member Author

Português

Adicionalmente, o mesmo acontece utilizando o modelo de busca de distância de palavras.

A busca "decreto orçamento"~7 (que procura pelos dois termos com uma distância de até 7 palavras entre elas) também retorna resultados corretos porém sem exibir o trecho.

URL da Requisição: https://queridodiario.ok.org.br/api/gazettes?since=2022-05-01&until=2022-05-31&querystring=%22decreto%20or%C3%A7amento%22~7&excerpt_size=50&number_of_excerpts=1&pre_tags=&post_tags=&size=30&sort_by=relevance

image

English

Additionally, the same happens using the slop amount query.

The search "decreto orçamento"~7 (which searches for the two terms with a distance of up to 7 words between them) also returns correct results but without displaying the snippet.

Request URL: https://queridodiario.ok.org.br/api/gazettes?since=2022-05-01&until=2022-05-31&querystring=%22decreto%20or%C3%A7amento%22~7&excerpt_size=50&number_of_excerpts=1&pre_tags=&post_tags=&size=30&sort_by=relevance

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants