2

次のエラーが表示されます。

JSON エラー

トップスタックトレース出力

コード エラーの場所

私のパラメータは

array (size=4)
  'facets' => string 'Instock.1' (length=9)
  'facetFilters' => string 'inStock.1:1' (length=11)
  'numericFilters' => string 'itemId!=511283' (length=14)
  'getRankingInfo' => int 1

getRankingInfo または numericFilters のいずれかを削除すると、すべてのリクエストに対して機能します。

Algolia のログによると、結果が返されていますが、一部のリクエストについては、それほど遠くまで到達できません。

エラーが表示される 1 つの応答は次のとおりです。

リクエスト

{
  "params": "facets=Instock.1&facetFilters=inStock.1%3A1&numericFilters=itemId%21%3D511283&getRankingInfo=1&query=WARBURTON+ORANGE+WRAPPER+800G"
}

応答

{
  "hits": [
    {
      "itemId": 506241,
      "name": "Warburton Blue Wrapper 800g",
      "slug": "506241-warburton-blue-wrapper",
      "brand": "Warburton",
      "supplier_name": "Warburtons Bread",
      "size": "800G",
      "status": "L",
      "vat_rate": "0.00",
      "popularity": 18992,
      "image": "/images/products/506241.jpg",
      "thumbnail": "/images/products/506241_thumbnail.jpg",
      "barcodes": [
        "5010044000039"
      ],
      "branches": [
        1,
        2,
        4,
        5,
        6
      ],
      "deepestCategory": "07013033337",
      "inStock": {
        "1": 1,
        "2": 0,
        "4": 1,
        "5": 1,
        "6": 1
      },
      "alternatives": [
      ],
      "objectID": "506241",
      "_highlightResult": {
        "name": {
          "value": "<em>Warburton</em> Blue <em>Wrapper</em> <em>800g</em>",
          "matchLevel": "partial",
          "matchedWords": [
            "warburton",
            "wrapper",
            "800g"
          ]
        },
        "barcodes": [
          {
            "value": "5010044000039",
            "matchLevel": "none",
            "matchedWords": [
            ]
          }
        ]
      },
      "_rankingInfo": {
        "nbTypos": 0,
        "firstMatchedWord": 0,
        "proximityDistance": 10,
        "userScore": 21542,
        "geoDistance": 0,
        "geoPrecision": 1,
        "nbExactWords": 3,
        "words": 3
      }
    },
    {
      "itemId": 511294,
      "name": "Warburton Green Wrapper ",
      "slug": "511294-warburton-green-wrapper",
      "brand": "Warburton",
      "supplier_name": "Warburtons Bread",
      "size": "",
      "status": "L",
      "vat_rate": "0.00",
      "popularity": 78098,
      "image": "/images/products/511294.jpg",
      "thumbnail": "/images/products/511294_thumbnail.jpg",
      "barcodes": [
        "5010044002347"
      ],
      "branches": [
        1,
        2,
        4,
        5,
        6
      ],
      "deepestCategory": "07013033337",
      "inStock": {
        "1":

正常に動作するものは次のとおりです。

リクエスト本文

{
  "params": "facets=Instock.1&facetFilters=inStock.1%3A1&numericFilters=itemId%21%3D558471&getRankingInfo=1&query=I+CAN%27T+BELIEVE+IT%27S+NOT+BUTTER+2KG"
}

応答

{
  "hits": [
    {
      "itemId": 581691,
      "name": "I Can't Believe Its Not Butter 500g",
      "slug": "581691-i-cant-believe-its-not-butter",
      "brand": "I Can't Believe",
      "supplier_name": "U.lever Bestfoods (chilled)",
      "size": "500G",
      "status": "L",
      "vat_rate": "0.00",
      "popularity": 36597,
      "image": "/images/products/581691.jpg",
      "thumbnail": "/images/products/581691_thumbnail.jpg",
      "barcodes": [
        "000118039904",
        "05000118039904",
        "5000241007009"
      ],
      "branches": [
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "deepestCategory": "07015269103",
      "inStock": {
        "1": 1,
        "2": 1,
        "3": 1,
        "4": 1,
        "5": 1,
        "6": 1
      },
      "alternatives": [
      ],
      "objectID": "581691",
      "_highlightResult": {
        "name": {
          "value": "<em>I</em> <em>Can't</em> <em>Believe</em> <em>Its</em> <em>Not</em> <em>Butter</em> 500g",
          "matchLevel": "partial",
          "matchedWords": [
            "i",
            "can",
            "t",
            "believe",
            "it",
            "s",
            "not",
            "butter"
          ]
        },
        "barcodes": [
          {
            "value": "000118039904",
            "matchLevel": "none",
            "matchedWords": [
            ]
          },
          {
            "value": "05000118039904",
            "matchLevel": "none",
            "matchedWords": [
            ]
          },
          {
            "value": "5000241007009",
            "matchLevel": "none",
            "matchedWords": [
            ]
          }
        ]
      },
      "_rankingInfo": {
        "nbTypos": 0,
        "firstMatchedWord": 0,
        "proximityDistance": 22,
        "userScore": 15914,
        "geoDistance": 0,
        "geoPrecision": 1,
        "nbExactWords": 6,
        "words": 8
      }
    },
    {
      "itemId": 247577,
      "name": "I Can't Believe Its Not Butter 250g"
4

1 に答える 1

0

結果セットがjson_decodeでエラーを起こしていたようです。hitsPerPage を 10 に制限すると、すべて正常に動作します。したがって、ここでの答えは、大規模なセットをページ付けすることです。

読んでコメントしてくれたすべての人に感謝します。

于 2016-01-21T11:26:24.347 に答える