Commit graph

10 commits

Author SHA1 Message Date
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
Phil Hughes
2a60f4dea8 Reduce query count for snippet search
Recudes the number of queries within the snippet search from approx. 50
to approx. 14 by preloading the authors

Part of #27392
2017-02-16 08:47:48 +00:00
Valery Sizov
03bed0fbd3 Clean up search result classes 2016-09-06 10:12:55 +03:00
Yorick Peterse
42fde69d39 Refactor Gitlab::SnippetSearchResults
This removes the need for plucking snippet IDs into memory.
2016-03-11 15:25:22 -05:00
Valery Sizov
8f929b8747 one more improvement to snippet search 2016-02-05 18:27:12 +02:00
Valery Sizov
94af78ac4a Faster snippet search 2016-02-05 18:20:29 +02:00
Valery Sizov
be7bc9d9b0 Backport some changes from EE 2016-01-22 11:24:44 +02:00
Charles Bushong
858dbd0842 Updating to persist a params snippets variable 2014-09-05 13:30:55 -04:00
Charles Bushong
b1411e90f8 Changing some formatting for the Hound, modifying some UI text 2014-09-02 08:33:23 -04:00
Charles Bushong
4cca1b050a Adding in snippet search functionality
http://feedback.gitlab.com/forums/176466-general/suggestions/5529795-search-though-snippets
2014-08-29 15:32:07 -04:00