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

✨ Image tab category search results for the search page #556

Open
neon-mmd opened this issue Apr 24, 2024 · 2 comments
Open

✨ Image tab category search results for the search page #556

neon-mmd opened this issue Apr 24, 2024 · 2 comments

Comments

@neon-mmd
Copy link
Owner

Description

Work Expected From The Issue

Provide image tab category search results for the new image tab category on the search page by providing an image category in the config with the search engines to be enabled in order to get image search results. Also, provide code to fetch them from the search engines.

The issue expects the following files to be changed/modified:

  • src/results/aggregator.rs
  • src/config/parser.rs
  • websurfx/config.rs
  • src/models/server_models.rs

Note

All the files that are expected to be changed are located under the codebase (websurfx directory).

Reason Behind These Changes

The reason behind having these changes is to provide image search results for the new image category on the search page which can provide more search results type for the user and improve the user experience.

Sample Code

Here is the sample code snippets which provides a general idea of what should be implemented for the above requested work:

Code snippet for search engine categories

upstream_search_engines = {
    general = {
        DuckDuckGo = true,
        Searx = false,
        Brave = false,
        Startpage = false,
        LibreX = false,
        Mojeek = false,
        Bing = false,
    },
    images = {
        DuckDuckGo = true,
    }
} -- select the upstream search engines from which the results should be fetched.

Code snippet for SearchParams struct

/// A named struct which deserializes all the user provided search parameters and stores them.
#[derive(Deserialize)]
pub struct SearchParams {
    /// It stores the search parameter option `q` (or query in simple words)
    /// of the search url.
    pub q: Option<String>,
    /// It stores the search parameter `page` (or pageno in simple words)
    /// of the search url.
    pub page: Option<u32>,
    /// It stores the search parameter `safesearch` (or safe search level in simple words) of the
    /// search url.
    pub safesearch: Option<u8>,
    pub type: Option<u8>,
}

Screenshots

No response

Do you want to work on this issue?

None

Additional information

No response

Copy link

The issue has been unlocked and is now ready for dev. If you would like to work on this issue, you can comment to have it assigned to you. You can learn more in our contributing guide https://github.com/neon-mmd/websurfx/blob/rolling/CONTRIBUTING.md

Copy link

Stale issue message

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
@neon-mmd neon-mmd reopened this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant