i have multiple tables make, model , year etc , using joins. search 1 text field. user type "audi a1 2015 red variant", , results on behalf of "audi a1 2015 red variant" correct sql should implement, suggestions appreciated?
select make.make_name, model.model_name cars inner join make on make.make_id = cars.fk_make_id inner join model on model.model_id = cars.fk_model_id cars.fk_make_id = 6 , (make.make_name '%audi a1%' or model.model_name '%audi a1%')
above sql returning 0 results.
achieving such not trivial task, need able determine token in user's input should compared field in table. there full-text search engine solutions out there elasticsearch, want achieve.
elasticsearch search engine based on lucene. provides distributed, multitenant-capable full-text search engine http web interface , schema-free json documents. elasticsearch developed in java , released open source under terms of apache license. elasticsearch popular enterprise search engine followed apache solr, based on lucene
-- wikipedia
if think elasticsearch steep learning curve you, suggest simplify breaking search form individual fields , save headache.
Comments
Post a Comment