in Education by
I have multiple tables like make, model and year etc and using joins. I would like to search from one text field. Like user will type "Audi A1 2015 Red Variant", and he will get results on behalf of this "Audi A1 2015 Red Variant" so what is the correct sql should i implement, your suggestions will be appreciated? SELECT make.make_name, model.model_name FROM cars INNER JOIN make ON make.make_id = cars.fk_make_id INNER JOIN model ON model.model_id = cars.fk_model_id WHERE cars.fk_make_id = 6 AND (make.make_name LIKE '%Audi A1%' OR model.model_name LIKE '%Audi A1%') Above sql returning 0 results. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Achieving such is not a trivial task, as you need to be able to determine what token in the user's input should be compared to what field in what table. There are probably full-text search engine solutions out there like elasticsearch, that already do what you want to achieve. Elasticsearch is a search engine based on Lucene. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Elasticsearch is developed in Java and is released as open source under the terms of the Apache License. Elasticsearch is the most popular enterprise search engine followed by Apache Solr, also based on Lucene -- Wikipedia If you think elasticsearch is a steep learning curve for you, I suggest you simplify by breaking your search form up into individual fields and save yourself some headache.

Related questions

0 votes
    I have multiple tables like make, model and year etc and using joins. I would like to search from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I'm getting an error with this function: Controller $data['carSubwoofers'] = $this->db->get_where(" ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    I am looking to get row count to check if same email is already in database or not. i have tried ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    Symfony version: 3.1.3 Due to development reason suddenly my app giving the following error and I believe ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    Hello! Like in title. There is code example. Result is: Nulla eu aliquet sapien. Sed in sagittis ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Hello! Like in title. There is code example. Result is: Nulla eu aliquet sapien. Sed in sagittis ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I do know that PDO does not support multiple queries getting executed in one statement. I've been Googleing ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
0 votes
    Registering members and allowing them to login (updating tables etc) all worked fine up until I made this change recently. ... , make the UserLevel 'Member'? Code for signing up:...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    why it's not working.. i want to update my table in database this is my code. for ($i=0; ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    After reading the chapter, I know these points: I know that data gets highlighted after being selected. I know ... entry and editing. Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    I am working on a resume database on elasticsearch. there are nested fields. For example, there is a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    Currently, when I submit a redux-form, and send the data-transfer-object to the backend, there is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    I have some data that looks like this: C:10 R:200 N/A E:3 N/A N:77 I'm trying to ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Suggestions needed for creating better and efficient search indexes for models having foreign key and many-to-many ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    I have encountered a problem during my work. There are over one hundred worksheets in my excel, and I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
...