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

Enable partial search #481

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Enable partial search #481

wants to merge 1 commit into from

Conversation

Imperatorn
Copy link

Problem
When searching for packages, partial maches are not found.

Example
Search for "jwt" on dub.pm -> https://code.dlang.org/search?q=jwt

Result
Does not find jwtd, only jwt

Proposed solution
Use partial search by changing query

Possible alternative solution
Configure partial search

Possible alternative solution 2
Enable usage of wildcard operator

NOTE
Untested solution

Problem:
When searching for packages, partial maches are not found.

Example:
Search for "jwt" on dub.pm -> https://code.dlang.org/search?q=jwt

Result:
Does not find jwtd, only jwt

Proposed solution:
Use partial search by changing query

Possible alternative solution:
Configure partial search

Possible alternative solution 2:
Enable usage of wildcard operator
@dlang-bot
Copy link
Collaborator

Thanks for your pull request and interest in making D better, @Imperatorn! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

@Imperatorn
Copy link
Author

Is the docker build broken?

error building image: error building stage: failed to get files used from context: failed to get fileinfo for /workspace/dub-registry: lstat /workspace/dub-registry: no such file or directory

@Imperatorn
Copy link
Author

Hmm, proposed solution might not work due to mongodb (never used it myself) does not do searches that way.
Maybe someone can use any of the other solutions or implement a partial search?

@Imperatorn Imperatorn marked this pull request as draft October 13, 2020 17:19
@Imperatorn
Copy link
Author

Is partial search possible?

@s-ludwig
Copy link
Member

AFAIK, MongoDB doesn't explicitly support partial searches. But what we could do is to manually perform a text search within the sorted list of package names and prioritize that up to a certain degree over the MongoDB results. That way we could implement any kind of partial matching and this would also solve the issue that text search prioritization is currently broken (the package name should have higher priority than e.g. the README contents, but currently this is typically not the case).

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.

3 participants