public PercolateRequestTests() { var doc = new ElasticsearchProject() { Id = 19, Name = "Hello" }; var request = new PercolateRequest<ElasticsearchProject>(doc) { Query = Query<ElasticsearchProject>.Term("color", "blue") }; var response = this._client.Percolate<ElasticsearchProject>(request); this._status = response.ConnectionStatus; }
/** * Return true if this percolateRequest object is equal to o. */ public override bool Equals(object o) { if (this == o) { return(true); } if (o == null || GetType() != o.GetType()) { return(false); } PercolateRequest percolateRequest = (PercolateRequest)o; return(object.Equals(this.query, percolateRequest.query)); }
public PercolateRequestTests() { var doc = new ElasticsearchProject() { Id = 19, Name = "Hello" }; var request = new PercolateRequest <ElasticsearchProject>(doc) { Query = Query <ElasticsearchProject> .Term("color", "blue") }; var response = this._client.Percolate <ElasticsearchProject>(request); this._status = response.ConnectionStatus; }
/** * Perform reverse search on a percolate index * Performs a percolate search. This method must be used only on percolate indexes. Expects two parameters: the index name and an object with array of documents to be tested. An example of the documents object: ``` {\"query\":{\"percolate\":{\"document\":{\"content\":\"sample content\"}}}} ``` Responds with an object with matched stored queries: ``` {'timed_out':false,'hits':{'total':2,'max_score':1,'hits':[{'_index':'idx_pq_1','_type':'doc','_id':'2','_score':'1','_source':{'query':{'match':{'title':'some'},}}},{'_index':'idx_pq_1','_type':'doc','_id':'5','_score':'1','_source':{'query':{'ql':'some | none'}}}]}} ``` * @param index Name of the percolate index (required) * @param percolateRequest (required) * @return ApiResponse<SearchResponse> * @throws ApiException if fails to make API call * @http.response.details * <table summary="Response Details" border="1"> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> * <tr><td> 200 </td><td> items found </td><td> - </td></tr> * <tr><td> 0 </td><td> error </td><td> - </td></tr> * </table> * * @see <a href="https://docs.manticoresearch.com/latest/html/http_reference/json_update.html">Perform reverse search on a percolate index Documentation</a> */ public ApiResponse <SearchResponse> PercolateWithHttpInfo(string index, PercolateRequest percolateRequest) { object localVarPostBody = percolateRequest; // verify the required parameter 'index' is set if (index == null) { throw new ApiException(400, "Missing the required parameter 'index' when calling percolate"); } // verify the required parameter 'percolateRequest' is set if (percolateRequest == null) { throw new ApiException(400, "Missing the required parameter 'percolateRequest' when calling percolate"); } // create path and Dictionary variables string localVarPath = Regex.Replace("/json/pq/{index}/search", "\\{" + "index" + "\\}", apiClient.EscapeString(index.ToString())); // query params List <Pair> localVarQueryParams = new List <Pair>(); Dictionary <string, string> localVarHeaderParams = new Dictionary <string, string>(); Dictionary <string, string> localVarCookieParams = new Dictionary <string, string>(); Dictionary <string, object> localVarFormParams = new Dictionary <string, object>(); string[] localVarAccepts = { "application/json" }; string localVarAccept = apiClient.SelectHeaderAccept(localVarAccepts); string[] localVarContentTypes = { "application/json" }; string localVarContentType = apiClient.SelectHeaderContentType(localVarContentTypes); string[] localVarAuthNames = new string[] { }; SearchResponse localVarReturnType = new SearchResponse() { }; return(apiClient.InvokeAPI("SearchApi.percolate", localVarPath, HttpMethod.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false)); }
/** * Perform reverse search on a percolate index * Performs a percolate search. This method must be used only on percolate indexes. Expects two parameters: the index name and an object with array of documents to be tested. An example of the documents object: ``` {\"query\":{\"percolate\":{\"document\":{\"content\":\"sample content\"}}}} ``` Responds with an object with matched stored queries: ``` {'timed_out':false,'hits':{'total':2,'max_score':1,'hits':[{'_index':'idx_pq_1','_type':'doc','_id':'2','_score':'1','_source':{'query':{'match':{'title':'some'},}}},{'_index':'idx_pq_1','_type':'doc','_id':'5','_score':'1','_source':{'query':{'ql':'some | none'}}}]}} ``` * @param index Name of the percolate index (required) * @param percolateRequest (required) * @return SearchResponse * @throws ApiException if fails to make API call * @http.response.details * <table summary="Response Details" border="1"> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> * <tr><td> 200 </td><td> items found </td><td> - </td></tr> * <tr><td> 0 </td><td> error </td><td> - </td></tr> * </table> * * @see <a href="https://docs.manticoresearch.com/latest/html/http_reference/json_update.html">Perform reverse search on a percolate index Documentation</a> */ public SearchResponse Percolate(string index, PercolateRequest percolateRequest) { return(PercolateWithHttpInfo(index, percolateRequest).GetData()); }