summaryrefslogtreecommitdiff
path: root/spec/unit/search/query_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Set explicit page size for every search requestssd/always-forwardSteven Danna2017-07-311-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The previous code would advance the search start parameter by either the user-provided rows parameter or (as a fallback) the number of rows returned in that page. Most code that calls the search() function does not set rows, so the fallback is used often. Since the search index may have stale results, it is possible to get responses with a completely empty page. For example: { "start": 0, "total": 1, "rows": [] } In this case, if no rows parameter was passed, the search function would infinitely recurse (eventually running out of stack). To avoid this, we set rows to 1000 if no user-provided value was set. This is the default page size of Chef Server so for most users it will not be changing the default behavior. Signed-off-by: Steven Danna <steve@chef.io>
* add a few testsLamont Granquist2017-03-311-1/+22
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Remove support for the sort option to searches.Noah Kantrowitz2017-03-201-15/+10
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* remove partial_searchtm/remove_partial_searchThom May2017-03-081-18/+0
| | | | Signed-off-by: Thom May <thom@chef.io>
* fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-171-14/+15
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* deal with 0.37.2 renamed copsLamont Granquist2016-02-181-8/+8
| | | | | | | | | | | | | | | 252 Style/TrailingCommaInLiteral 84 Style/TrailingCommaInArguments 15 Style/SpaceAroundKeyword -- 351 Total We already dealt with SpaceAroundKeyword under its old name SpaceBeforeModifierKeyword, it looks like it got stricter about spaces after keywords. TrailingComma also got split, and it looks like the TrailingCommaInArguments behavior is new?
* autofixing auto-inserted delimiterslcg/chefstyle-batchLamont Granquist2016-02-091-1/+1
|
* auto fixing some rubocopsLamont Granquist2016-02-091-1/+1
| | | | | | | | | Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
* autofixing whitespace copsLamont Granquist2016-02-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-021-1/+1
| | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* Replace all Opscode copyrights with Chef Software.Noah Kantrowitz2016-02-021-1/+1
| | | Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-021-1/+1
| | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Use double quotes by defaultThom May2016-01-141-6/+6
| | | | | | | This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
* autocorrecting Style/TrailingCommalcg/trailing_commaLamont Granquist2016-01-131-21/+21
| | | | chefstyle -a fixed 1044 occurrances
* Convert all uses of Chef::REST to Chef::ServerAPItm/no_more_restThom May2016-01-111-16/+20
| | | | | | | In the process, stop auto-expanding JSON in the HTTP client, and let individual classes control that themselves. Fixes #2737, Fixes #3518
* Fix search result paginationssd/search-pagination-fixSteven Danna2015-10-091-1/+19
| | | | | | | | | | | | | | | | | | | The start and rows parameter that are passed as part of the search request are passed directly to Solr on the backend. Results from Solr may contain deleted nodes no longer in the erchef database. Erchef will filter such nodes from the results. Thus, a user may receive fewer rows than they asked for. Incrementing 'start' only by the number of rows received will then result in the next Solr response overlapping the first, which can lead to duplicate results. In the case of a Solr results page that was completely filtered, it would lead to an infinite loop. This commit changes the code to always increment by the requested page size (args[:rows]) when it is non-nil. Incrementing by the length of the response set is still wrong in the case when the args[:rows] is nil, but the server doesn't give us anything else to increment by. Fixes #4027
* Test that search queries make progressSteven Danna2015-03-251-0/+24
|
* Build configurable search string.mcquin/bugfix/search-filteringClaire McQuin2014-12-191-5/+5
|
* Return all matches by default.Claire McQuin2014-12-181-5/+5
|
* Require a file that exists.Claire McQuin2014-12-181-1/+1
|
* No more should.Claire McQuin2014-12-181-15/+15
|
* Make search with filtering match partial_search.Claire McQuin2014-12-181-34/+22
| | | | * Updated search to use argument parameters.
* Update to RSpec 3.Claire McQuin2014-10-291-30/+30
|
* Add InvalidSearchQuery exception for malformed searches.Claire McQuin2014-09-041-2/+3
|
* Fix typos, add partial_search spec.Claire McQuin2014-09-041-46/+99
|
* Updated based on mcq and others feedbackScott Hain2014-09-041-250/+111
|
* Refactored thanks to some great inputScott Hain2014-09-041-0/+4
|
* Updated based on awesome feedbackScott Hain2014-09-041-11/+19
|
* Finished up search with filteringScott Hain2014-09-041-20/+249
|
* fix should_not raise_error(SpecificException)Lamont Granquist2014-01-291-2/+2
|
* s/mock\(/double(/gLamont Granquist2014-01-291-3/+3
|
* s/stub!/stub/gLamont Granquist2014-01-291-2/+2
| | | | fix deprecation warnings
* Normalize whitespace on all filesSeth Vargo2013-09-261-3/+3
|
* [OC-3564] move core Chef to the repo root \o/ \m/Seth Chisamore2012-10-301-0/+99
The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo!