summaryrefslogtreecommitdiff
path: root/lib/chef/search
Commit message (Collapse)AuthorAgeFilesLines
* prepping for rubocop 0.52.1lcg/rubocop-0.52.1Lamont Granquist2018-01-171-2/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Set explicit page size for every search requestssd/always-forwardSteven Danna2017-07-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | 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/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* apply knife search node fuzzifier to knife sshLamont Granquist2017-03-311-1/+17
| | | | | | | extracts out a common 'fuzz' option to Chef::Search::Query so that anyone can use it. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Remove support for the sort option to searches.Noah Kantrowitz2017-03-201-8/+9
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* remove partial_searchtm/remove_partial_searchThom May2017-03-081-22/+0
| | | | Signed-off-by: Thom May <thom@chef.io>
* Stop using obsolete URI.escape; use Addressable::URI instead.John Keiser2016-08-221-6/+9
| | | | See http://stackoverflow.com/questions/2824126/whats-the-difference-between-uri-escape-and-cgi-escape#answer-13059657 for details on why.
* fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-171-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Autofixing new Perf cops in 0.37.2Lamont Granquist2016-02-231-1/+1
| | | | | | | | | | 6 Performance/Casecmp 18 Performance/Detect 1 Performance/RangeInclude 27 Performance/RedundantBlockCall 6 Performance/RedundantMatch 5 Performance/RedundantMerge 18 Performance/StringReplacement
* convert MultilineOperationIndentation style to "indented"Lamont Granquist2016-02-121-2/+2
| | | | this looks nicer.
* autofixing whitespace copsLamont Granquist2016-02-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | 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-13/+13
| | | | | | | 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.
* Convert all uses of Chef::REST to Chef::ServerAPItm/no_more_restThom May2016-01-111-4/+18
| | | | | | | 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-2/+16
| | | | | | | | | | | | | | | | | | | 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
* Ensure that a search query makes progressTom Hughes2015-03-251-1/+1
| | | | | | | | If a search doesn't return a full result then increment the start pointer by the number of rows returned, rather than assuming that it was equal to the row limit, and defaulting to zero. This should fix #3099
* Build configurable search string.mcquin/bugfix/search-filteringClaire McQuin2014-12-191-1/+9
|
* Remaining fixes.Claire McQuin2014-12-191-3/+3
| | | | | | * Exclude rows from query if rows are nil. * Update defaults in knife/search to match query defaults. * Update start when polling more rows.
* Fix spelling.Claire McQuin2014-12-191-1/+1
|
* Make config a reader.Claire McQuin2014-12-191-2/+2
|
* Use 2.0 syntax (required keyword arguments are 2.1+).Claire McQuin2014-12-191-2/+2
|
* Fix whitespace.Claire McQuin2014-12-191-5/+4
|
* Allow search to receive either an array or hash of arguments.Claire McQuin2014-12-191-44/+37
|
* Add optional config parameter.Claire McQuin2014-12-181-3/+9
|
* Return all matches by default.Claire McQuin2014-12-181-2/+1
|
* Make search with filtering match partial_search.Claire McQuin2014-12-181-86/+60
| | | | * Updated search to use argument parameters.
* Add InvalidSearchQuery exception for malformed searches.Claire McQuin2014-09-041-4/+17
|
* Fix typos, add partial_search spec.Claire McQuin2014-09-041-13/+7
|
* Comment :keys => :filter_result in partial_searchClaire McQuin2014-09-041-3/+5
|
* DEPRECATIONScott Hain2014-09-041-0/+1
|
* updated partial againScott Hain2014-09-041-2/+20
|
* Updated based on mcq and others feedbackScott Hain2014-09-041-38/+53
|
* added a default for ruby 1.8 compatibilityScott Hain2014-09-041-1/+2
|
* Last round of life improvementScott Hain2014-09-041-10/+9
|
* Refactored thanks to some great inputScott Hain2014-09-041-32/+17
|
* Fixed the stupid typo that broke the last buildScott Hain2014-09-041-2/+2
|
* fixed up some little naming nuancesScott Hain2014-09-041-2/+4
|
* Updated based on awesome feedbackScott Hain2014-09-041-48/+65
|
* Finished up search with filteringScott Hain2014-09-041-6/+67
|
* [CHEF-4176] remove unneeded aliases for chef_server_urldanielsdeleo2013-05-101-2/+2
|
* [OC-3564] move core Chef to the repo root \o/ \m/Seth Chisamore2012-10-301-0/+65
The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo!