如何在天蓝色搜索中编写过滤查询以访问特定字段(集合)?

时间:2019-04-24 13:09:26

标签: azure azure-search

我在下面有azure搜索REST API响应

  My REST API Query is 
    https://myresource.search.windows.net/indexes/myresume-index/docs?api-version=2017-11-11&queryType=full&count=true&search=*
Response
        {
            "@odata.context": "https://myresource.search.windows.net/indexes('myresume-index')/$metadata#docs(*)",
            "value": [
                {
                    "@search.score": 1,
                    "id": "Lakshmi_11",
                    "LastName": "Sripuram",
                    "Profile": null,
                    "Profiles": null,
                    "Education": [
                        "{\"certificate_degree_name\":\"ITI\",\"major\":\"MCA\",\"Institute_name\":\"Chaitanya Insitute of Technology\",\"starting_date\":\"04/07/2010\",\"completion_date\":\"24/4/2012\",\"percentage\":65.6,\"cgpa\":6}"
                    ],
                    "Experience": [
                        "{\"is_current_job\":\"Yes\",\"start_date\":\"24/2/2018\",\"job_title\":\"Senior SAP Developer\",\"enterprise_name\":\"Infosys\",\"job_location_city\":\"Hyderabad\",\"job_location_state\":\"Telangana\",\"job_location_country\":\"India\",\"description\":\"I have an experience in Testing field\"}"
                    ],
                    "Skills": [
                        "{\"skill_set_id\":1258,\"skill_level\":\"High\"}"
                    ],
                    "IsRegistered": false,
                    "rid": "MOY0ALzMD6UBAAAAAAAAAA=="
                },
                {
                    "@search.score": 1,
                    "id": "Preethi_12",
                    "LastName": "DasaraRaju",
                    "Profile": null,
                    "Profiles": null,
                    "Education": [
                        "{\"certificate_degree_name\":\"ITI\",\"major\":\"ITI\",\"Institute_name\":\"valaboju engineering college\",\"starting_date\":\"18/05/2014\",\"completion_date\":\"20/04/2016\",\"percentage\":85.2,\"cgpa\":9}"
                    ],
                    "Experience": [
                        "{\"is_current_job\":\"Yes\",\"start_date\":\"24/3/2019\",\"job_title\":\"PegaDeveloper\",\"enterprise_name\":\"Wipro\",\"job_location_city\":\"Pune\",\"job_location_state\":\"Maharastra\",\"job_location_country\":\"India\",\"description\":\"I have an experience in .NET Technologies\"}"
                    ],
                    "Skills": [
                        "{\"skill_set_id\":1587,\"skill_level\":\"Low\"}"
                    ],
                    "IsRegistered": false,
                    "rid": "MOY0ALzMD6UCAAAAAAAAAA=="
                }

是否可以从经验字段(其中job_title等于“ PegaDeveloper”)编写查询。在这里,我只需要显示job_title的“体验”字段。有关我在

中尝试使用过滤器查询的问题,请提供任何帮助
azure search given below but it is not working.
https://myresource.search.windows.net/indexes/myresume-index/docs?api-version=2017-11-11&queryType=full&$count=true&$select=Experience&search=&$filter=Experience.job_title eq "pegadeveloper"

1 个答案:

答案 0 :(得分:0)

您想要做的是创建一个索引,其中某些字段是“复杂的”。 我相信目前,您已将“体验”字段建模为字符串的集合。

这意味着类似Experience.job_title eq "xyz"之类的查询在语义上不会等同于您的实际情况。

当前,可以预览具有复杂字段(复杂类型或复杂类型的集合)的索引的功能,并且很快将普遍可用。我建议您转到此User Voice页以了解更多信息。