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

Filtering notes using hashtag combinations and hashtags with underscore doesn't work as expected #2587

Closed
caugner opened this issue Apr 13, 2020 · 2 comments

Comments

@caugner
Copy link

caugner commented Apr 13, 2020

We have been creating notes using the hashtags #caresteouvert and #DE to easily filter notes created by the Ca reste ouvert project by country.

➡️ Unfortunately querying notes for #caresteouvert #DE didn't properly filter using these hashtags, but instead using the words caresteouvert and de (as in "details").

As a reaction, we changed the hashtagging to #caresteouvert #caresteouvert_DE.

➡️ Unfortunately querying notes for #caresteouvert_DE still had exactly the same result.

As a workaround, we will probably migrate to #caresteouvertDE, but it would be great if the Notes API filtering implementation could be adjusted to better accoung for hashtags and hashtags including underscores.

See also: ENT8R/NotesReview#57

According to @ENT8R, the search string filtering happens here (which might be where the fix could happen):

@notes = @notes.joins(:comments).where("to_tsvector('english', note_comments.body) @@ plainto_tsquery('english', ?)", params[:q]) if params[:q]

@ENT8R
Copy link
Contributor

ENT8R commented Apr 13, 2020

Actually, this is quite similar to #2585
The search method is so simple that it doesn't suit most use cases. I also have no clue if it would be a good idea to add additional logic to the search... Maybe it would be better to use a different service than the API directly in order to search and filter notes (and show them in the interface of NotesReview), like @tomhughes already pointed out in #2585. The only problem is that I'm not aware of any service like that.
I really would like to work on something similar, the only thing that keeps me from doing is, is that the notes database dump is only generated on a daily basis. It is nice that they are exported every day, but often this seems to be a long time. @tomhughes Is there some possibility to get the notes from the database in real time?
One way I could think of is simply fetching the notes from the API in a given interval by the time they were last updated (https://api.openstreetmap.org/api/0.6/notes/search.json?sort=updated_at) and importing it in some kind of database.

@tomhughes
Copy link
Member

Duplicate of #2585.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants