Azure搜索索引更新了文档问题

时间:2014-10-19 16:53:00

标签: azure azure-search

使用搜索索引架构中具有GeographyPoint类型的字段更新我的索引文档时出现问题。 更新索引文档时它会给我400 Bad request error。我使用了以下一些数据格式来更新Edm.GeographyPoint类型的字段。

  1. " Point(-125.2251 253365)" - > '点(长,LAT)'
  2. " SSID = 1426; Point(-125.2511 256255)"
  3. " {" type":" Point"," coordinates":[ - 127.892345987345,45.598345897]}"
  4. 当我除了这个字段并更新索引文档时,它会成功更新。是否有#34; Edm.GeographyPoint"的数据格式有任何问题?输入字段或其他内容。 还有一个人认为我在这个领域有得分。

    "scoringProfiles":{ "name": "ratingAll",
        "functions": [
            {
                "type": "magnitude",
                "fieldName": "rating_all",
                "boost": 10,
                "interpolation": "linear",
                "magnitude": {
                    "boostingRangeStart": 1,
                    "boostingRangeEnd": 10,
                    "constantBoostBeyondRange": false
                }
            }
        ]
    },
    {   "name": "geoDistance",
        "functions": [
            {
                "type": "distance",
                "fieldName": "geolocation",
                "boost": 20,
                "interpolation": "logarithmic",
                "distance": {
                "referencePointParameter": "currentLocation",
                "boostingDistance": 10 
                }
    
            }
        ]
    }
    

    这是我在搜索索引

    上传的json数据
    { "value": [{"@search.action": "mergeOrUpload","id_art": "ID8106","name": "Hakone","summary": "Authentic Japanese cuisine, buffet style","description": "Hakone is located in the [AID:7794] and offers up buffet style sushi and Japanese cuisine for dinner only.","city": "Honolulu","zip": "96815","date_entered": "2014-06-10T00:31:00Z","description_category": "Restaurants","description_location": "O'ahu","rating_all": 0,"geolocation": "{"type": "Point", "coordinates": [-157.840011566877, 21.286421555374])}"},{"@search.action": "mergeOrUpload","id_art": "ID8110","name": "Aloha Trolley","summary": "Trolley that stops at several convenient locations around the Waikiki area.","description": "The Aloha Trolley is is geared toward visitors that really enjoy being tourists. You simply buy a day pass from JBT Global Travel Services which operates the trolley, and you can cruise around Waikiki all day long with on / off privileges.","city": "Honolulu","zip": "96814","date_entered": "2014-02-14T06:19:00Z","description_category": "Shops / Services","description_location": "O'ahu","rating_all": 6,"geolocation": "{"type": "Point", "coordinates": [0, 0])}"}] }
    

1 个答案:

答案 0 :(得分:0)

选项#3(GeoJSON点)是正确的语法。你遇到了什么错误?如果您可以分享您发布的JSON,我可以看看。