opensearch-project / opensearch-php

Official PHP Client for OpenSearch
Other
110 stars 58 forks source link

Updated documentation for search #105

Closed harrowmykel closed 2 years ago

harrowmykel commented 2 years ago

Description

search(array $params = []) function does not show the following. so I added it

/*
* $params['stats']                         = (list) Specific 'tag' of the request for logging and statistical purposes
     * $params['suggest_field']                 = (string) Specify which field to use for suggestions
     * $params['suggest_mode']                  = (enum) Specify suggest mode (Options = missing,popular,always) (Default = missing)
     * $params['suggest_size']                  = (number) How many suggestions to return in response
     * $params['suggest_text']                  = (string) The source text for which the suggestions should be returned
     * $params['timeout']                       = (time) Explicit operation timeout
     * $params['track_scores']                  = (boolean) Whether to calculate and return scores even if they are not used for sorting
     * $params['track_total_hits']              = (boolean) Indicate if the number of documents that match the query should be tracked
     * $params['allow_partial_search_results']  = (boolean) Indicate if an error should be returned if there is a partial search failure or timeout (Default = true)
     * $params['typed_keys']                    = (boolean) Specify whether aggregation and suggester names should be prefixed by their respective types in the response
     * $params['version']                       = (boolean) Specify whether to return document version as part of a hit
     * $params['seq_no_primary_term']           = (boolean) Specify whether to return sequence number and primary term of the last modification of each hit
     * $params['request_cache']                 = (boolean) Specify if request cache should be used for this request or not, defaults to index level setting
     * $params['batched_reduce_size']           = (number) The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. (Default = 512)
     * $params['max_concurrent_shard_requests'] = (number) The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests (Default = 5)
     * $params['pre_filter_shard_size']         = (number) A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
     * $params['rest_total_hits_as_int']        = (boolean) Indicates whether hits.total should be rendered as an integer or an object in the rest search response (Default = false)
     * $params['body']
     * @param array $params Associative array of parameters
     * @return array
     * 
     * */

Issues Resolved

101

wbeckler commented 2 years ago

This is awesome! Thank you! Just for the reviewers' sakes, I noticed that some of this is verbatim from an API spec here: https://github.com/elastic/elasticsearch/blob/c5930851043522c69613f68b2ac3b8ac3dfbcfbe/rest-api-spec/src/main/resources/rest-api-spec/api/search.json#L162-L165

The above spec is Apache License v2.0, and therefore a contribution based on it is compatible with its license.

So, it doesn't look like a licensing issue.

dblock commented 2 years ago

Thanks! Please fix DCO (needs git commit -s).

codecov-commenter commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@cf91bd8). Click here to learn what that means. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #105   +/-   ##
=======================================
  Coverage        ?   26.96%           
  Complexity      ?     1934           
=======================================
  Files           ?      245           
  Lines           ?     5544           
  Branches        ?        0           
=======================================
  Hits            ?     1495           
  Misses          ?     4049           
  Partials        ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

harrowmykel commented 2 years ago

Ok. i have done that

shyim commented 2 years ago

As well here you have to signoff all your commits