Skip to content

pip search not working if pkg name contains '-' #3819

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

Closed
Ayub-Khan opened this issue Apr 25, 2018 · 5 comments
Closed

pip search not working if pkg name contains '-' #3819

Ayub-Khan opened this issue Apr 25, 2018 · 5 comments
Labels
search Elasticsearch, search filters, and so on

Comments

@Ayub-Khan
Copy link

  • Pip version:
    9.0.1 and 10.0.1
  • Python version:
    python 2 and python 3
  • Operating system:
    Ubuntu

Description:

pip search edx-i18n-tools
Expected Behavior :
It should show the version and summery of latest version
Actual Behavior :
shows Nothing

pip search edx-ace
Expected Behavior :
It should show the version and summery of latest version
Actual Behavior :
shows Nothing

pip search edxval
Expected Behavior :
It should show the version and summery of latest version
Actual Behavior :
shows correctly

###Another issue
search also not works if the word is not in lower case in pkg description
ie.
pip search internationalization
It should show all the libraries which have Internationalization/internationalization in their pkg description
only shows one with name internationalization.

###Another issue
Search also does not work if query string is not in lower case
ie.
pip search edx
works shows a list

pip search edX
shows nothing
it should show the same list as 'pip search edx'
pip search EDX
it should show the same list as 'pip search edx'

pypa/pip#5332

@nlhkabu nlhkabu added the search Elasticsearch, search filters, and so on label Apr 26, 2018
@ewdurbin
Copy link
Member

I think the results for all provided examples make more sense in the "main" search.

Looks like we should be able to make results for pip search more sensible by applying the same search logic/boosting. I'm gonna approach this shortly.

@ewdurbin
Copy link
Member

all reported issue here were resolved in #3827

@Ayub-Khan
Copy link
Author

@ewdurbin thanks a lot for fixing the issue. I ran the following command to verify the behavior
pip search edx-i18n
pip search django-filter
It is working fine but it seems it is showing all results for 'edx' combined with all results of 'i18n'. it is treating it as two different strings django and filter and showing the union of result sets for both. it should only show the results if whole query string is in name or summry right ?

@ewdurbin
Copy link
Member

@Ayub-Khan I believe your theory is correct, though I'm not sure how to improve that.

@Ayub-Khan
Copy link
Author

Ayub-Khan commented Apr 27, 2018

@ewdurbin es using the match query, changing to match_phrase will fix this. But after making some more queries im not sure whats the best option here. As both have their advantages and disadvantages. But as this a command line search, may be chose 'match' as default option and allow user to change it using command line argument? . i just looked at #3717. It seems changing it to match_phrase will break it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
search Elasticsearch, search filters, and so on
Projects
None yet
Development

No branches or pull requests

3 participants