AWS Cloudsearch NET或Javascript - 无法访问2011-02-01领域的搜索请求

时间:2017-07-04 15:34:24

标签: javascript c# asp.net aws-sdk amazon-cloudsearch

我在AWS Cloudsearch上迈出了第一步(我需要使用CloudSearch的开发人员工具)

我需要访问以下网址: https://search-memtestsearch-ra5knmztzu6iq4ntytlxkntqty.us-east-1.cloudsearch.amazonaws.com/2011-02-01/search?bq=subjectfirstname:%27alex%27&return-fields=subjectlastname,subjectfirstname&results-type=json

但是两个API(NET和Javascript)都试图访问: https://search-memtestsearch-ra5knmztzu6iq4ntytlxkntqty.us-east-1.cloudsearch.amazonaws.com/2013-01-01/search?bq=subjectfirstname:%27alex%27&return-fields=subjectlastname,subjectfirstname&results-type=json

我现在不知道如何访问“/ 2011-02-01”域而不是“/ 2013-01-01”域... 我知道这与版本有关,但我不知道如何访问;我也找不到这方面的例子。

我疯了:)

这是我用于NET的代码:

        String queryUrl = @"http://search-memtestsearch-ra5knmztzu6iq4ntytlxkntqty.us-east-1.cloudsearch.amazonaws.com";
        AmazonCloudSearchDomainClient searchClient = new AmazonCloudSearchDomainClient(queryUrl);
        SearchRequest searchRequest = new SearchRequest();
        searchRequest.Query = .....
        searchRequest.QueryParser =....
        SearchResponse searchResponse = searchClient.Search(searchRequest);

这是Javascript的一个:

            var csd = new AWS.CloudSearchDomain({
              endpoint: 'http://search-memtestsearch-ra5knmztzu6iq4ntytlxkntqty.us-east-1.cloudsearch.amazonaws.com',
              apiVersion: '2011-02-01',
              region: 'us-east-1'
            });
            var params = {...}
            csd.search(params, function (err, data) {
                if (err){ console.log(err, err.stack); // an error occurred
                }else{console.log(data);           // successful response
            }});

有人可以用一个例子来帮助我吗? 提前致谢

塞巴斯蒂安

0 个答案:

没有答案