コード例 #1
0
            public void DeleteBySearch(Query query)
            {
                ParameterMap parameters = query.ToParameterMap();

                try
                {
                    CallApi<Dictionary<string, Object>>(DELETE_METHOD, indexUrl + SEARCH_URL, parameters, PrivatePass);
                }
                catch (HttpCodeException e)
                {
                    switch (e.GetHttpCode())
                    {
                        case 400:
                            throw new InvalidSyntaxException(e);
                        case 404:
                            throw new IndexDoesNotExistException(e);
                        default:
                            throw new UnexpectedCodeException(e);
                    }
                }
            }
コード例 #2
0
            public SearchResults Search(Query query)
            {
                ParameterMap parameters = query.ToParameterMap();

                try
                {
                    return
                        new SearchResults(CallApi<Dictionary<string, Object>>(GET_METHOD, indexUrl + SEARCH_URL, parameters, PrivatePass));
                }
                catch (HttpCodeException e)
                {
                    if (e.GetHttpCode() == 400)
                    {
                        throw new InvalidSyntaxException(e);
                    }

                    throw new UnexpectedCodeException(e);
                }
            }