Ask the great God to help answer the question of ' elasticsearch ', see the document can not see a step to

Source: Internet
Author: User
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 ' =&gt ;        []                ]            ]        ];        $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 ' =&gt ;        []                ]            ]        ];        $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

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.