2

is it possible to Search Data with Amazon CloudSearch using unique document ID of an individual hit

example:result getting in Json Formate

stdClass Object
(
[rank] => -text_relevance
[match-expr] => (label company_name:'Greenline')
[hits] => stdClass Object        
   (
        [found] => 6
        [start] => 0
        [hit] => Array
            (
                [0] => stdClass Object                       
                (
                        [id] => ras_csv_693
                        [data] => stdClass Object

                      (
                                [all_us_sic_codes] => Array
                                    (
                                        [0] => 55719901
                                    )

                                [company_name] => Array
                                    (
                                        [0] => Greenline Equipment
                                    )

                                [contact_first_name] => Array
                                    (
                                        [0] => John
                                    )

                                [total_employees] => Array
                                    (
                                        [0] => 30
                                    )

                            )

                    )
  )

Submitting Search Requests in Amazon CloudSearch like this "http://search-movies-rr2f34ofg56xneuemujamut52i.us-east-1.cloudsearch. amazonaws.com/2011-02-01/search?bq=company_name:'Greenline'&return-fields=all_us_sic_codes,company_name,contact_first_name,total_employees" i got above example result in json format.

i want to make use of "[id] => ras_csv_693" in example,so by using this "id", searched again like this "2011-02-01/search?q=id:ras_csv_693" but i didnt get any result.. please help me to get result...

4

2 回答 2

7

尽管您在 2011-02-01 版本中询问了如何执行此操作,但 2013-01-01 版本中的语法有很大不同,值得展示。

要在 CloudSearch API 的 2013-01-01 版本中按 ID 搜索文档,您可以使用结构化查询_id:'THE_ID'作为查询。对于您的示例,您将要求:

.../2013-01-01/search?q.parser=structured&q=_id:'ras_csv_693'

于 2014-09-25T20:05:19.117 回答
3

您可以使用以下文档 ID 搜索:?bq=docid:'ras_csv_693'

例子:

http://search-movies-rr2f34ofg56xneuemujamut52i.us-east-1.cloudsearch.amazonaws.com/2011-02-01/search?bq=docid:'ras_csv_693'&return-fields=all_us_sic_codes,company_name,contact_first_name,total_employees

请注意,必须对 URL 进行编码才能工作,这里我不编码只是为了便于理解。

于 2013-01-16T02:49:10.747 回答