Elasticsearch ohne Antwortdaten in PHPPhp

PHP-Programmierer chatten hier
Anonymous
 Elasticsearch ohne Antwortdaten in PHP

Post by Anonymous »

This is my mapping:

$ curl -X GET -k -u elastic:elastic "http://127.0.0.1:9200/_mapping"

Code: Select all

{"photobank":{"mappings":{"properties":{"id":{"type":"long"},"title":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}}}}

Ich habe Testdaten wie Titel: "AAA" und "BBB" und "CCC" wie folgt eingefügt:
array (
'index' => 'photobank',
'id' => '79',
'body' =>
array (
'title' => 'aaa',
'id' => 79,
),
)
$response = $client->index($params);
< /code>
Die Daten werden mit dem Antwortstatuscode = 201 und der ReasonPhrase = "erstellt" gespeichert.$params = [
'index' => 'photobank',
'body' => [
'query' => [
/*'match' => [
'title' => 'aaa'
],*/
'bool' => [
'must' => [
'match' => [
'title' => 'aaa'
]
],
]
]
],
];
$response = $client->search($params);
< /code>
$ Antwort hat nur Statuscode 200, aber nichts weiter. Wo sind Ergebnisdaten oder ist meine Abfrage falsch?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post