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

created search buffer #541

Merged
merged 1 commit into from
Jul 10, 2023
Merged

created search buffer #541

merged 1 commit into from
Jul 10, 2023

Conversation

Arfs6
Copy link
Contributor

@Arfs6 Arfs6 commented Jun 1, 2023

Created a minimal search buffer. It definitely needs more work. I didn't wanted to go far on the wrong way.

  1. created: src/controller/buffers/mastodon/search.py - It has the SearchBuffer. It inherits from BaseBuffer. It overwrites start_stream and remove_buffer. My mastodon account doesn't have enough activity for me to test pagination and create the get_more_items method. Does search really have pagination and is it ordered?
  2. edited src/buffers/mastodon/init.py - imported SearchBuffer for Controller.create_buffer to access
  3. edited src/mastodon/handler.py - edited the pub send message part of the search method to create the appropriate buffer with the appropriate info.
  4. edited: mastodon.defaults - Added [other_buffers][[post_searches] list to hold already created searches.
    We could add support for hashtags with this easily. And what way should we take care of searches that yields zero results.

@manuelcortez
Copy link
Member

This looks promising. Have you actually checked text searches? I'm already on a full time job and a part time one, so have had no time recently. But I definitely will take a deeper look this weekend. I'd like to know if this has been already tested as I have not yet text searches on my test instance.

@Arfs6
Copy link
Contributor Author

Arfs6 commented Jun 3, 2023

From the mastodon.py's docs:

Full-text search is only enabled if the instance supports it, and is restricted to statuses the logged-in user wrote or was mentioned in.
Copied from the docs string documentation of the search method ( mastodon/search.py ).
Regarding the testing part, I am not sure if it really works. Searching for some words I wrote yields some posts. I have very little posts and just recently moved to a new instance.

@manuelcortez manuelcortez merged commit ceee777 into MCV-Software:next-gen Jul 10, 2023
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

Successfully merging this pull request may close these issues.

2 participants