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

[Feat] Add cargo package search #3487

Merged
merged 1 commit into from
May 17, 2024
Merged

Conversation

dkuku
Copy link
Contributor

@dkuku dkuku commented May 14, 2024

What does this PR do?

Add cargo package search
this depends on changes from #3464
image

searx/engines/cargo.py Outdated Show resolved Hide resolved
searx/engines/cargo.py Outdated Show resolved Hide resolved
searx/engines/cargo.py Outdated Show resolved Hide resolved
@dalf dalf mentioned this pull request May 14, 2024
15 tasks


def request(query: str, params):
args = urlencode({"page": params["pageno"], "q": query, "per_page": 20})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per_page could be made configurable in settings.yml by making it a global variable called page_size, but that's not mandatory

Copy link
Member

@return42 return42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the module from cargo.py to crates.io .. "cargo" is the package manager while "crates.io" is just one package repository / may we want to implement for example https://lib.rs/ at one day.

Due to the rebase on

and the rename to crates.py this PR has changed significantly .. can you please review again / thanks!

"results": "JSON",
}

categories = ["it", "packages", "cargo"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can further use !cargo .. when we implement other cargo reposetories we will add this engines also to group cargo .. so with !cargo we are able to search through all cargo managers in once.


# engine dependent config
paging = True
page_size = 10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @Bnyro mentioned .. the page_size is configurable and I reduced from 20 to 10 .. 10 results per page is the default what we have in nearly all engines.

engine: crates
shortcut: crates
disabled: true
timeout: 6.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to say: I had timeout issues on search terms like !cargo test or !cargo lib .. so I increased timeout from the default 3sec to 6sec .. not sure this is a good value.

@dkuku
Copy link
Contributor Author

dkuku commented May 17, 2024

Can this be merged? I don't have permissions.

@return42
Copy link
Member

Can this be merged? I don't have permissions.

sure .. I was just waiting for the OK from you for my modifications :-)

@return42 return42 merged commit a49232e into searxng:master May 17, 2024
9 checks passed
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.

None yet

3 participants