Configuration for accessing Amazon CloudSearchDomain service
Inheritance: Amazon.Runtime.ClientConfig
 /// <summary>
 /// Constructs AmazonCloudSearchDomainClient with AWS Credentials and an
 /// AmazonCloudSearchDomainClient Configuration object.
 /// </summary>
 /// <param name="credentials">AWS Credentials</param>
 /// <param name="clientConfig">The AmazonCloudSearchDomainClient Configuration Object</param>
 public AmazonCloudSearchDomainClient(AWSCredentials credentials, AmazonCloudSearchDomainConfig clientConfig)
     : base(credentials, clientConfig)
 {
 }
 /// <summary>
 /// Constructs AmazonCloudSearchDomainClient with AWS Access Key ID, AWS Secret Key and an
 /// AmazonCloudSearchDomainClient Configuration object. 
 /// </summary>
 /// <param name="awsAccessKeyId">AWS Access Key ID</param>
 /// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
 /// <param name="awsSessionToken">AWS Session Token</param>
 /// <param name="clientConfig">The AmazonCloudSearchDomainClient Configuration Object</param>
 public AmazonCloudSearchDomainClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonCloudSearchDomainConfig clientConfig)
     : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
 {
 }
 /// <summary>
 /// Constructs AmazonCloudSearchDomainClient with the credentials loaded from the application's
 /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
 /// 
 /// Example App.config with credentials set. 
 /// <code>
 /// &lt;?xml version="1.0" encoding="utf-8" ?&gt;
 /// &lt;configuration&gt;
 ///     &lt;appSettings&gt;
 ///         &lt;add key="AWSProfileName" value="AWS Default"/&gt;
 ///     &lt;/appSettings&gt;
 /// &lt;/configuration&gt;
 /// </code>
 ///
 /// </summary>
 /// <param name="config">The AmazonCloudSearchDomainClient Configuration Object</param>
 public AmazonCloudSearchDomainClient(AmazonCloudSearchDomainConfig config)
     : base(FallbackCredentialsFactory.GetCredentials(true), config)
 {
 }
 public AmazonCloudSearchDomainClient(AmazonCloudSearchDomainConfig config)
     : base(new AnonymousAWSCredentials(), config, AuthenticationTypes.User | AuthenticationTypes.Session)
 {
 }
        public IResultSet Search(ISearchQuery query)
        {
            AmazonCloudSearchDomainConfig config = new AmazonCloudSearchDomainConfig();
            config.ServiceURL = "http://search-index2-cdduimbipgk3rpnfgny6posyzy.eu-west-1.cloudsearch.amazonaws.com/";
            AmazonCloudSearchDomainClient domainClient = new AmazonCloudSearchDomainClient("AKIAJ6MPIX37TLIXW7HQ", "DnrFrw9ZEr7g4Svh0rh6z+s3PxMaypl607eEUehQ", config);
            SearchRequest searchRequest = new SearchRequest();
            List<string> suggestions = new List<string>();
            StringBuilder highlights = new StringBuilder();
            highlights.Append("{\'");

            if (query == null)
                throw new ArgumentNullException("query");

            foreach (var field in query.HighlightedFields)
            {
                if (highlights.Length > 2)
                {
                    highlights.Append(", \'");
                }

                highlights.Append(field.ToUpperInvariant());
                highlights.Append("\':{} ");
                SuggestRequest suggestRequest = new SuggestRequest();
                Suggester suggester = new Suggester();
                suggester.SuggesterName = field.ToUpperInvariant() + "_suggester";
                suggestRequest.Suggester = suggester.SuggesterName;
                suggestRequest.Size = query.Take;
                suggestRequest.Query = query.Text;
                SuggestResponse suggestion = domainClient.Suggest(suggestRequest);
                foreach (var suggest in suggestion.Suggest.Suggestions)
                {
                    suggestions.Add(suggest.Suggestion);
                }
            }

            highlights.Append("}");

            if (query.Filter != null)
            {
                searchRequest.FilterQuery = this.BuildQueryFilter(query.Filter);
            }

            if (query.OrderBy != null)
            {
                searchRequest.Sort = string.Join(",", query.OrderBy);
            }

            if (query.Take > 0)
            {
                searchRequest.Size = query.Take;
            }

            if (query.Skip > 0)
            {
                searchRequest.Start = query.Skip;
            }

            searchRequest.Highlight = highlights.ToString();
            searchRequest.Query = query.Text;
            searchRequest.QueryParser = QueryParser.Simple;
            var result = domainClient.Search(searchRequest).SearchResult;

            return new AmazonResultSet(result, suggestions);
        }
 /// <summary>
 /// Constructs AmazonCloudSearchDomainClient with AWS Access Key ID, AWS Secret Key and an
 /// AmazonCloudSearchDomainClient Configuration object.
 /// </summary>
 /// <param name="awsAccessKeyId">AWS Access Key ID</param>
 /// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
 /// <param name="awsSessionToken">AWS Session Token</param>
 /// <param name="clientConfig">The AmazonCloudSearchDomainClient Configuration Object</param>
 public AmazonCloudSearchDomainClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonCloudSearchDomainConfig clientConfig)
     : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
 {
 }
 /// <summary>
 /// Constructs AmazonCloudSearchDomainClient with the credentials loaded from the application's
 /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
 ///
 /// Example App.config with credentials set.
 /// <code>
 /// &lt;?xml version="1.0" encoding="utf-8" ?&gt;
 /// &lt;configuration&gt;
 ///     &lt;appSettings&gt;
 ///         &lt;add key="AWSProfileName" value="AWS Default"/&gt;
 ///     &lt;/appSettings&gt;
 /// &lt;/configuration&gt;
 /// </code>
 ///
 /// </summary>
 /// <param name="config">The AmazonCloudSearchDomainClient Configuration Object</param>
 public AmazonCloudSearchDomainClient(AmazonCloudSearchDomainConfig config)
     : base(FallbackCredentialsFactory.GetCredentials(true), config)
 {
 }
 /// <summary>
 /// Constructs AmazonCloudSearchDomainClient with AWS Credentials and an
 /// AmazonCloudSearchDomainClient Configuration object.
 /// </summary>
 /// <param name="credentials">AWS Credentials</param>
 /// <param name="clientConfig">The AmazonCloudSearchDomainClient Configuration Object</param>
 public AmazonCloudSearchDomainClient(AWSCredentials credentials, AmazonCloudSearchDomainConfig clientConfig)
     : base(credentials, clientConfig)
 {
 }
 /// <summary>
 /// Constructs AmazonCloudSearchDomainClient with AWS Credentials and an
 /// AmazonCloudSearchDomainClient Configuration object.
 /// </summary>
 /// <param name="credentials">AWS Credentials</param>
 /// <param name="clientConfig">The AmazonCloudSearchDomainClient Configuration Object</param>
 public AmazonCloudSearchDomainClient(AWSCredentials credentials, AmazonCloudSearchDomainConfig clientConfig)
     : base(credentials, clientConfig, AuthenticationTypes.User | AuthenticationTypes.Session)
 {
 }
 /// <summary>
 /// Constructs AmazonCloudSearchDomainClient with the credentials loaded from the application's
 /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
 ///
 /// Example App.config with credentials set.
 /// <code>
 /// &lt;?xml version="1.0" encoding="utf-8" ?&gt;
 /// &lt;configuration&gt;
 ///     &lt;appSettings&gt;
 ///         &lt;add key="AWSProfileName" value="AWS Default"/&gt;
 ///     &lt;/appSettings&gt;
 /// &lt;/configuration&gt;
 /// </code>
 ///
 /// </summary>
 /// <param name="config">The AmazonCloudSearchDomainClient Configuration Object</param>
 public AmazonCloudSearchDomainClient(AmazonCloudSearchDomainConfig config)
     : base(FallbackCredentialsFactory.GetCredentials(true), config, AuthenticationTypes.User | AuthenticationTypes.Session)
 {
 }
 /// <summary>
 /// Constructs AmazonCloudSearchDomainClient with AWS Access Key ID, AWS Secret Key and an
 /// AmazonCloudSearchDomainClient Configuration object.
 /// </summary>
 /// <param name="awsAccessKeyId">AWS Access Key ID</param>
 /// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
 /// <param name="awsSessionToken">AWS Session Token</param>
 /// <param name="clientConfig">The AmazonCloudSearchDomainClient Configuration Object</param>
 public AmazonCloudSearchDomainClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonCloudSearchDomainConfig clientConfig)
     : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig, AuthenticationTypes.User | AuthenticationTypes.Session)
 {
 }
 public AmazonCloudSearchDomainClient(AmazonCloudSearchDomainConfig config)
     : base(new AnonymousAWSCredentials(), config, AuthenticationTypes.User | AuthenticationTypes.Session)
 {
 }