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

[Feature] add precise search type for Elastic Search #12869

Merged
merged 17 commits into from
Jan 27, 2021
Merged

[Feature] add precise search type for Elastic Search #12869

merged 17 commits into from
Jan 27, 2021

Conversation

jnlin
Copy link
Contributor

@jnlin jnlin commented Sep 16, 2020

Added a query parameter t=match on /explore/code and /repo/search, which add precise search feature for code search with Elastic Search.

routers/home.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 16, 2020
routers/repo/search.go Outdated Show resolved Hide resolved
@lafriks lafriks added the type/enhancement An improvement of existing functionality label Sep 16, 2020
@lafriks lafriks modified the milestones: 1.13.0, 1.14.0 Sep 16, 2020
@lafriks
Copy link
Member

lafriks commented Sep 16, 2020

Sorry could not decide about version 😆

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2020

Codecov Report

Merging #12869 into master will decrease coverage by 0.00%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12869      +/-   ##
==========================================
- Coverage   42.60%   42.59%   -0.01%     
==========================================
  Files         671      671              
  Lines       73625    73644      +19     
==========================================
+ Hits        31366    31369       +3     
- Misses      37179    37192      +13     
- Partials     5080     5083       +3     
Impacted Files Coverage Δ
modules/indexer/code/elastic_search.go 1.73% <0.00%> (-0.03%) ⬇️
modules/indexer/code/indexer.go 35.95% <ø> (ø)
routers/home.go 46.96% <0.00%> (-0.54%) ⬇️
modules/indexer/code/bleve.go 70.08% <68.75%> (-1.08%) ⬇️
modules/context/pagination.go 100.00% <100.00%> (ø)
modules/indexer/code/search.go 83.09% <100.00%> (ø)
modules/indexer/code/wrapped.go 48.88% <100.00%> (ø)
routers/repo/search.go 73.33% <100.00%> (+2.96%) ⬆️
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
modules/indexer/stats/db.go 60.86% <0.00%> (-8.70%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe79b13...38996b6. Read the comment docs.

@jnlin
Copy link
Contributor Author

jnlin commented Sep 16, 2020

@lafriks committed, thanks!

@lafriks
Copy link
Member

lafriks commented Sep 16, 2020

Could you add this functionality also for blevesearch as imho it should support it

@jolheiser
Copy link
Member

This also needs some documentation somewhere, as otherwise there's no way to actually use it without knowing the magic query parameter.

@jnlin
Copy link
Contributor Author

jnlin commented Sep 16, 2020

This also needs some documentation somewhere, as otherwise there's no way to actually use it without knowing the magic query parameter.

Added a dropdown in e94a59b for this

@jnlin
Copy link
Contributor Author

jnlin commented Sep 16, 2020

Could you add this functionality also for blevesearch as imho it should support it

I am not familiar with bleve, need more time to do some research

@jnlin
Copy link
Contributor Author

jnlin commented Sep 17, 2020

I am not familiar with bleve, need more time to do some research

ready for review

modules/indexer/code/bleve.go Outdated Show resolved Hide resolved
modules/indexer/code/bleve.go Outdated Show resolved Hide resolved
modules/indexer/code/bleve.go Outdated Show resolved Hide resolved
modules/indexer/code/bleve.go Outdated Show resolved Hide resolved
@jnlin
Copy link
Contributor Author

jnlin commented Sep 18, 2020

ready for review

Copy link
Member

@lafriks lafriks left a comment

Choose a reason for hiding this comment

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

LGTM, just small spacing nit

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 18, 2020
Co-authored-by: Lauris BH <lauris@nix.lv>
@lunny
Copy link
Member

lunny commented Jan 27, 2021

Please resolve the conflicts.

@jnlin
Copy link
Contributor Author

jnlin commented Jan 27, 2021

ready for review

@codecov-io
Copy link

Codecov Report

Merging #12869 (49812fb) into master (b2c20b6) will increase coverage by 0.00%.
The diff coverage is 57.14%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #12869   +/-   ##
=======================================
  Coverage   42.11%   42.11%           
=======================================
  Files         758      758           
  Lines       81085    81104   +19     
=======================================
+ Hits        34148    34157    +9     
- Misses      41360    41369    +9     
- Partials     5577     5578    +1     
Impacted Files Coverage Δ
modules/indexer/code/elastic_search.go 1.73% <0.00%> (-0.03%) ⬇️
modules/indexer/code/indexer.go 35.95% <ø> (ø)
routers/home.go 48.10% <0.00%> (-0.56%) ⬇️
modules/indexer/code/bleve.go 70.08% <68.75%> (-1.08%) ⬇️
modules/context/pagination.go 85.71% <100.00%> (+0.71%) ⬆️
modules/indexer/code/search.go 83.09% <100.00%> (ø)
modules/indexer/code/wrapped.go 48.88% <100.00%> (ø)
routers/repo/search.go 73.33% <100.00%> (+2.96%) ⬆️
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
modules/process/manager.go 72.50% <0.00%> (-2.50%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b2c20b6...49812fb. Read the comment docs.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 27, 2021
@lafriks lafriks merged commit c10503a into go-gitea:master Jan 27, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants