completed job Description:
1. Elasticsearch and related plugins have been installed on the local Windows machine.
2. The elasticsearch-php client is then installed in the Laravel.
3, wrote the following such a Searchcontroller controller:
Client = \elasticsearch\clientbuilder::create ()->build (); The Public Function index () {$params = [' Index ' = ' node ', ' type ' = ' article ', ' body ' = = [' query ' and ' = ' match_all ' + []] ] ]; $response = $this->client->search ($params); Print_r ($response); The public function Create () {$params = [' Index ' = ' node ', ' type ' = ' article ', ' id ' = ' 1029 ', ' body ' = = [' query ' and ' = ' match_all ' => ; [] ] ] ]; $response = $this->client->index ($params); Print_r ($response); Public function Store (Request $request) {} public Function Show ($id) {} Public Function edit ($id) {} Public Function update (Request $request, $id) {} public Function destrOy ($id) {}}
Problem Description:
1, although completed the above 3 steps, but now no clue, see the document also can not see a step. The concrete manifestation is: what do I need to do if I want to articles
index and query a data table called now? It's best to say what you do every step of the way. Thank you.
2. What does ' index ', ' type ', ' body ' mean?
3, if not MySQL, directly using ES to save the index, the index file default in what directory?
Reply content:
Completed Job Description:
1. Elasticsearch and related plugins have been installed on the local Windows machine.
2. The elasticsearch-php client is then installed in the Laravel.
3, wrote the following such a Searchcontroller controller:
Client = \elasticsearch\clientbuilder::create ()->build (); The Public Function index () {$params = [' Index ' = ' node ', ' type ' = ' article ', ' body ' = = [' query ' and ' = ' match_all ' + []] ] ]; $response = $this->client->search ($params); Print_r ($response); The public function Create () {$params = [' Index ' = ' node ', ' type ' = ' article ', ' id ' = ' 1029 ', ' body ' = = [' query ' and ' = ' match_all ' => ; [] ] ] ]; $response = $this->client->index ($params); Print_r ($response); Public function Store (Request $request) {} public Function Show ($id) {} Public Function edit ($id) {} Public Function update (Request $request, $id) {} public Function destrOy ($id) {}}
Problem Description:
1, although completed the above 3 steps, but now no clue, see the document also can not see a step. The concrete manifestation is: what do I need to do if I want to articles
index and query a data table called now? It's best to say what you do every step of the way. Thank you.
2. What does ' index ', ' type ', ' body ' mean?
3, if not MySQL, directly using ES to save the index, the index file default in what directory?
Recently, I've just contacted Es.
Es can correspond to a MySQL database
The concept of index is equivalent to the library
The concept of type is equivalent to the table
Document is the equivalent of a record
Then you have to operate, you must first have a library, to have a table, to make additions and deletions to check and change
How to index and search to see the document?
The index file is stored as a file ES_HOME/data
under
Logstash JDBC Plugin You can go to the official website to find the JDBC file