Commit Graph

65 Commits

Author SHA1 Message Date
GitLab Bot 4fd77e112f Add latest changes from gitlab-org/gitlab@master 2020-11-05 00:09:16 +00:00
GitLab Bot 6e320396b2 Add latest changes from gitlab-org/gitlab@master 2020-10-26 12:08:44 +00:00
GitLab Bot 19dd462661 Add latest changes from gitlab-org/gitlab@master 2020-10-23 03:08:37 +00:00
GitLab Bot 8a902a9508 Add latest changes from gitlab-org/gitlab@master 2020-10-22 03:08:25 +00:00
GitLab Bot 6ae38bb3b5 Add latest changes from gitlab-org/gitlab@master 2020-10-15 12:09:06 +00:00
GitLab Bot 1ec1bec4ee Add latest changes from gitlab-org/gitlab@master 2020-10-08 15:08:17 +00:00
GitLab Bot 4ed4dc08a8 Add latest changes from gitlab-org/gitlab@master 2020-10-01 03:09:55 +00:00
GitLab Bot bfb1d5b17b Add latest changes from gitlab-org/gitlab@master 2020-09-30 03:09:46 +00:00
GitLab Bot e6bcd6e738 Add latest changes from gitlab-org/gitlab@master 2020-09-25 09:09:40 +00:00
GitLab Bot a071c2888d Add latest changes from gitlab-org/gitlab@master 2020-09-23 12:09:58 +00:00
GitLab Bot 27c4555a42 Add latest changes from gitlab-org/gitlab@master 2020-09-22 21:10:04 +00:00
GitLab Bot 692f4b734f Add latest changes from gitlab-org/gitlab@master 2020-09-03 21:08:18 +00:00
GitLab Bot a1aeaba23e Add latest changes from gitlab-org/gitlab@master 2020-09-03 09:08:20 +00:00
GitLab Bot f2eb66fef8 Add latest changes from gitlab-org/gitlab@master 2020-08-21 03:10:16 +00:00
GitLab Bot ff1701e51d Add latest changes from gitlab-org/gitlab@master 2020-07-10 06:09:23 +00:00
GitLab Bot 9bded6fb22 Add latest changes from gitlab-org/gitlab@master 2020-05-20 06:08:06 +00:00
GitLab Bot 17c8111494 Add latest changes from gitlab-org/gitlab@master 2020-05-07 21:09:26 +00:00
GitLab Bot e33f87ac0f Add latest changes from gitlab-org/gitlab@master 2020-04-21 15:21:10 +00:00
Eugenia Grieff 6ff7788d4c Fix labels finder to filter visible issuables
Use project scopes to filter project labels

Add changelog file

Check  issuables visibility in  LabelsFinder

Add specs for issuables visibility cases

Rename Project method to reuse in LabelsFinder

Remove commented code

Improve changelog title
2019-10-22 17:00:56 +01:00
GitLab Bot e0bd3a45d9 Add latest changes from gitlab-org/gitlab@master 2019-10-01 21:06:09 +00:00
Francisco Javier López 107ebb8251 Lower searches count limit
Lowering the limit when performing search from 1001 to 101.
This will allow us to speed this process.
2019-09-09 13:46:24 +00:00
Markus Koller 49c83155cc
Load search result counts asynchronously
Querying all counts for the different search results in the same request
led to timeouts, so we now only calculate the count for the *current*
search results, and request the others in separate asynchronous calls.
2019-08-12 22:01:15 +02:00
Nick Thomas 06440b12d8
Revert "Avoid loading objects from DB in ES results"
This reverts commit d9cb907c3e.
2019-06-13 11:07:55 +01:00
Mario de la Ossa f2698e05eb
Backport of 10854-elasticsearch_avoid_db 2019-06-05 14:42:00 -06:00
Felipe Artur b70b43d07e Resolve: Milestones leaked via search API
Fix milestone titles being leaked using search API
when users cannot read milestones
2019-05-20 11:08:34 -03:00
Francisco Javier López 68e533dc21 Add improvements to the global search process
Removed the conditions added to
Project.with_feature_available_for_user, and moved to the
IssuableFinder. Now, we ensure that, in the projects retrieved
in the Finder, the user has enough access for the feature.
2019-05-07 11:08:25 +00:00
Jasper Maes 624a1cdab4 Upgrade Rails to 5.1.6.1
Model.new.attributes now also returns encrypted attributes.
2019-04-23 08:31:23 +08:00
Alexis Reigel 6385c7229c
move users method to public section
this is for EE to be able to call this (elastic search)
2019-03-14 18:30:30 +01:00
Alexis Reigel 4c684a8d5c
check ability for user search results 2019-03-14 18:21:03 +01:00
Alexis Reigel 65df88c490
move ability check from service class to view 2019-03-14 18:16:03 +01:00
Alexis Reigel 70261ff11c
add users search results to global search 2019-03-14 18:15:40 +01:00
Jan Provaznik 58bfd73331 Optimized file search to work without limits
* removed 100 limit on file search results because we
  load all results anyway
* expensive processing (parsing match content, utf encoding)
  is done only for selected page in paginated output
2018-12-06 09:25:09 +01:00
Mark Chao 0fa5260f1d Allow search results to accept project_id
This gives flexiblity to avoid duplicated query of Project.
2018-10-30 15:44:55 +08:00
Mark Chao a4ba973e24 Allow FoundBlob to access language from gitattributes
Extract language_from_git_attributes as a concern so it can
ben included in two blob classes.
2018-10-30 15:44:55 +08:00
Mark Chao bc14e4ed10 Move :plain option to Highlight class
This is to DRY the repeated file size check.

Move spec and constants to Highlight
2018-10-30 15:44:55 +08:00
Mark Chao 32f9cf8ce3 Add BlobPresenter for highlighting
Force FoundBlob to use BlobPresenter
2018-10-30 15:44:55 +08:00
Mark Chao 6580de78bb Add access to Blob's language from gitattributes
Ported from Highlight class since it as a concept is more related to
blob, and this allows more flexibility.
2018-10-30 15:44:55 +08:00
gfyoung c858f70d07 Enable frozen string for lib/gitlab/*.rb 2018-10-22 07:00:50 +00:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Sean McGivern 06a226a1c0 Fix code and wiki search results when filename is non-ASCII
Previously, we only handled non-ASCII file contents, but the name itself can be
non-ASCII.
2018-03-12 10:43:13 +00:00
Jan Provaznik 741caf93e1 Use limited count queries also for scoped searches 2018-03-05 13:25:56 +00:00
Sean McGivern b3c096cddc Fix code search results with non-ASCII data
Gitlab::Git::Popen#popen now returns ASCII-8BIT (binary) data always, so we need
to handle that explicitly.
2018-02-28 10:22:04 +00:00
Jarka Kadlecová b0b4ae1875 API - Include project in commits&blobs search results 2018-02-14 09:00:26 +01:00
Jarka Kadlecová 7381944565 Support search in API 2018-02-06 16:02:02 +01:00
Jan Provaznik 090ca9c33e Use limit for search count queries
Search query is especially slow if a user searches a generic string
which matches many records, in such case search can take tens of
seconds or time out. To speed up the search query, we search only for
first 1000 records, if there is >1000 matching records we just display
"1000+" instead of precise total count supposing that with such amount
the exact count is not so important for the user.

Because for issues even limited search was not fast enough, 2-phase
approach is used for issues: first we use simpler/faster query to get
all public issues, if this exceeds the limit, we just return the limit.
If the amount of matching results is lower than limit, we re-run more
complex search query (which includes also confidential issues).
Re-running the complex query should be fast enough in such case because the
amount of matching issues is lower than limit.

Because exact total_count is now limited, this patch also switches to
to "prev/next" pagination.

Related #40540
2018-01-23 22:33:42 +01:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Jan Provaznik 017c1297cd Skip projects filter on issues search
When searching for issues, an additional subquery
is added which filters only issues in a project. If global context is
used (no project is specified) this query filters all projects user has
access to.

In that case we can skip this filter because filtering only projects
user has access to is added anyway.

The filter is used only if a custom project context is specified

Related to #40540
2018-01-02 12:07:26 +01:00
Jan Provaznik d2f1d585e1 Skip projects filter on merge requests search
When searching for merge requests, an additional subquery
is added which by default filters only merge requests which belong
to source or target project user has permission for.

This filter is not needed because more restrictive filter
which checks if user has permission for target project
is used in the query.

So unless a custom projects filter is used by user, it's possible
to skip the default projects filter and speed up the final query.

Related to #40540
2017-12-21 15:43:14 +01:00
Douwe Maan 8041a87288 Drastically improve project search performance by no longer searching namespace name 2017-11-24 15:57:17 +01:00
Nick Thomas 7f32ad7097 Fix blob highlighting in search 2017-04-03 18:51:44 +01:00