2014-05-12 3 views
0

일련의 문서를 ElasticSearch로 색인화하려고합니다.400 색인 생성시 잘못된 요청

510 개체는 (ElasticHQ에서) 적절히 색인화되지만 (적어도) 하나의 요청은 400 개의 잘못된 요청 오류를 발생시킵니다.

array (size=2) 
    'body' => 
    array (size=29) 
     'sNameLngFr' => string 'Pinot Blanc D'alsace Stã©phane Berg' (length=37) 
     'pPrix' => float 4.99 
     'iPromotion' => int 0 
     'pPromotion' => float 4.99 
     'sColor' => string 'blancsec' (length=8) 
     'sColorLngFr' => string 'Blanc Sec' (length=9) 
     'sColorLngNl' => string 'Droge witte wijn' (length=16) 
     'sProducerUrl' => string '' (length=0) 
     'iVintage' => int 2012 
     'sPackageType' => string '6bouteilles' (length=11) 
     'sPackageTypeLngFr' => string '6 bouteilles' (length=12) 
     'sPackageTypeLngNl' => string '6 flessen' (length=9) 
     'sKeepingPotentialLngFr' => string '2015' (length=4) 
     'sKeepingPotentialLngNl' => string '' (length=0) 
     'sVolume' => string '75cl' (length=4) 
     'pays' => 
     array (size=3) 
      'iPays' => int 10 
      'sNameLngFr' => string 'France' (length=6) 
      'sNameLngNl' => string 'Frankrijk' (length=9) 
     'region' => 
     array (size=3) 
      'iRegion' => int 29 
      'sNameLngFr' => string 'Alsace' (length=6) 
      'sNameLngNl' => string 'Alsace' (length=6) 
     'appellation' => 
     array (size=3) 
      'iAppelation' => int 49 
      'sNameLngFr' => string 'Alsace Pinot ou Klevner' (length=23) 
      'sNameLngNl' => string 'Alsace Pinot ou Klevner' (length=23) 
     'sProducer' => string 'S. BERG ORSCHWILLER' (length=19) 
     'iKeepingPotential' => int 0 
     'sCommentaireLngFr' => string '' (length=0) 
     'sCommentaireLngNl' => string '' (length=0) 
     'sExternalRef' => string '718182' (length=6) 
     'sFood1' => string '13' (length=2) 
     'sFood2' => string '8' (length=1) 
     'sFood3' => string '3' (length=1) 
     'sEanBarcode' => string '' (length=0) 
     'iFamilyId' => int 71 
     'sFullExternalRef' => string '00718182' (length=8) 
    'id' => int 1465 

이 그 오류의 원인이, 내가 인덱스에 노력하고있어 개체입니다 ... 이 문서 빈 말한다

exception 'Guzzle\Http\Exception\ClientErrorResponseException' with message 'Client error response 
[status code] 400 
[reason phrase] Bad Request 
[url] http://localhost:9200/vins/vin/1465' in /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:43 
Stack trace: 
#0 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Message\Response)) 
#1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) 
#2 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) 
#3 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'request.error', Object(Guzzle\Common\Event)) 
#4 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(589): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('request.error', Object(Guzzle\Common\Event)) 
#5 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(378): Guzzle\Http\Message\Request->processResponse(Array) 
#6 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequest.php(49): Guzzle\Http\Message\Request->setState('complete', Array) 
#7 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(290): Guzzle\Http\Message\EntityEnclosingRequest->setState('complete', Array) 
#8 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(248): Guzzle\Http\Curl\CurlMulti->processResponse(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array) 
#9 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(231): Guzzle\Http\Curl\CurlMulti->processMessages() 
#10 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(215): Guzzle\Http\Curl\CurlMulti->executeHandles() 
#11 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(109): Guzzle\Http\Curl\CurlMulti->perform() 
#12 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMultiProxy.php(94): Guzzle\Http\Curl\CurlMulti->send() 
#13 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Client.php(284): Guzzle\Http\Curl\CurlMultiProxy->send() 
#14 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(198): Guzzle\Http\Client->send(Object(Guzzle\Http\Message\EntityEnclosingRequest)) 
#15 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php(162): Guzzle\Http\Message\Request->send() 
#16 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php(98): Elasticsearch\Connections\GuzzleConnection->sendRequest(Object(Guzzle\Http\Message\EntityEnclosingRequest), false) 
#17 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(162): Elasticsearch\Connections\GuzzleConnection->performRequest('PUT', '/vins/vin/1465', Array, false) 
#18 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/AbstractEndpoint.php(86): Elasticsearch\Transport->performRequest('PUT', '/vins/vin/1465', Array, Array) 
#19 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Client.php(857): Elasticsearch\Endpoints\AbstractEndpoint->performRequest() 
#20 /Users/nicolaswidart/Sites/Mestdagh_2/modules/elasticsearch/classes/Indexers/VinIndexer.php(70): Elasticsearch\Client->index(Array) 
#21 /Users/nicolaswidart/Sites/Mestdagh_2/modules/elasticsearch/controllers/ControlElasticsearchService.php(16): VinIndexer->indexOne('1465') 
#22 [internal function]: ControlElasticsearchService->indexOne('1465') 
#23 /Users/nicolaswidart/Sites/Mestdagh_2/core/application/module/controller/Controller.php(410): call_user_func(Array, '1465') 
#24 /Users/nicolaswidart/Sites/Mestdagh_2/core/application/Application.php(170): Controller->run(Array, false) 
#25 /Users/nicolaswidart/Sites/Mestdagh_2/core/application/Application.php(136): Application->startMainController() 
#26 /Users/nicolaswidart/Sites/Mestdagh_2/index.php(87): Application->run() 
#27 {main} 

Next exception 'Elasticsearch\Common\Exceptions\BadRequest400Exception' with message '{"error":"MapperParsingException[failed to parse, document is empty]","status":400}' in /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php:239 
Stack trace: 
#0 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php(167): Elasticsearch\Connections\GuzzleConnection->process4xxError(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Exception\ClientErrorResponseException), false) 
#1 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php(98): Elasticsearch\Connections\GuzzleConnection->sendRequest(Object(Guzzle\Http\Message\EntityEnclosingRequest), false) 
#2 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(162): Elasticsearch\Connections\GuzzleConnection->performRequest('PUT', '/vins/vin/1465', Array, false) 
#3 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/AbstractEndpoint.php(86): Elasticsearch\Transport->performRequest('PUT', '/vins/vin/1465', Array, Array) 
#4 /Users/nicolaswidart/Sites/Mestdagh_2/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Client.php(857): Elasticsearch\Endpoints\AbstractEndpoint->performRequest() 
#5 /Users/nicolaswidart/Sites/Mestdagh_2/modules/elasticsearch/classes/Indexers/VinIndexer.php(70): Elasticsearch\Client->index(Array) 
#6 /Users/nicolaswidart/Sites/Mestdagh_2/modules/elasticsearch/controllers/ControlElasticsearchService.php(16): VinIndexer->indexOne('1465') 
#7 [internal function]: ControlElasticsearchService->indexOne('1465') 
#8 /Users/nicolaswidart/Sites/Mestdagh_2/core/application/module/controller/Controller.php(410): call_user_func(Array, '1465') 
#9 /Users/nicolaswidart/Sites/Mestdagh_2/core/application/Application.php(170): Controller->run(Array, false) 
#10 /Users/nicolaswidart/Sites/Mestdagh_2/core/application/Application.php(136): Application->startMainController() 
#11 /Users/nicolaswidart/Sites/Mestdagh_2/index.php(87): Application->run() 
#12 {main} 

하지만되지 않습니다 :이 전체 스택 트레이스입니다 색인 된 510 개의 문서에서 무작위 검색을 수행하면 다음과 같이 표시됩니다.

array (size=3) 
     'total' => int 61 
     'max_score' => float 0.99237627 
     'hits' => 
     array (size=10) 
      0 => 
      array (size=5) 
       '_index' => string 'vins' (length=4) 
       '_type' => string 'vin' (length=3) 
       '_id' => string '938' (length=3) 
       '_score' => float 0.99237627 
       '_source' => 
       array (size=29) 
        'sNameLngFr' => string 'Chateau Vieux Ligat' (length=19) 
        'pPrix' => float 5.89 
        'iPromotion' => int 0 
        'pPromotion' => float 5.89 
        'sColor' => string 'rougefruité' (length=12) 
        'sColorLngFr' => string 'Rouge Fruité' (length=13) 
        'sColorLngNl' => string 'Fruitige rode wijn' (length=18) 
        'sProducerUrl' => string '' (length=0) 
        'iVintage' => int 2010 
        'sPackageType' => string '6bouteilles' (length=11) 
        'sPackageTypeLngFr' => string '6 bouteilles' (length=12) 
        'sPackageTypeLngNl' => string '6 flessen' (length=9) 
        'sKeepingPotentialLngFr' => string '2015' (length=4) 
        'sKeepingPotentialLngNl' => string '' (length=0) 
        'sVolume' => string '75 cl' (length=5) 
        'pays' => 
        array (size=3) 
         'iPays' => int 10 
         'sNameLngFr' => string 'France' (length=6) 
         'sNameLngNl' => string 'Frankrijk' (length=9) 
        'region' => 
        array (size=3) 
         'iRegion' => int 31 
         'sNameLngFr' => string 'Bordeaux' (length=8) 
         'sNameLngNl' => string 'Bordeaux' (length=8) 
        'appellation' => 
        array (size=3) 
         'iAppelation' => int 71 
         'sNameLngFr' => string 'Bordeau' (length=7) 
         'sNameLngNl' => string 'Bordeau' (length=7) 
        'sProducer' => string 'SERGE SEGUIN' (length=12) 
        'iKeepingPotential' => int 0 
        'sCommentaireLngFr' => string '<p dir="LTR">Un vin rouge aux belles notes de fruits rouges. Fin et délicat, il accompagnera viandes rouges et fromages</p>' (length=124) 
        'sCommentaireLngNl' => string '<p>Een rode wijn met rode vruchtenaroma's. Fijn en delikaat, perfect met rood vlees en kaas.</p>' (length=96) 
        'sExternalRef' => string '711290' (length=6) 
        'sFood1' => string '3' (length=1) 
        'sFood2' => string '4' (length=1) 
        'sFood3' => string '6' (length=1) 
        'sEanBarcode' => string '9990259121902' (length=13) 
        'iFamilyId' => int 71 
        'sFullExternalRef' => string '00711290' (length=8) 
      1 => 

따라서 표시된 일부 속성은 비어 있으며 색인이 잘됩니다.

이 오류가 발생하는 이유는 무엇입니까? 그 특정한 물건에?

감사합니다.

답변

2

이 두 줄에는 forbiden char가 있으므로 이스케이프 처리하면 작동 할 수 있습니다.

+0

'''을 제거하려고 시도했지만 문제가 지속됩니다. 추가 조사가 끝난 후 문제를 일으킨 strtolower 인 것으로 보입니다. 그것 없이는 문제없이 색인을 생성 할 수 있습니다. –