2013-07-15

Basically I have two tables Location and city, The city has city_name and country_code. location_name field from location table has locations. I want to find the location country.

My table structure.

City table

Location table

So I Indexed the two fields(country_code and city_name) in city table using Zend Lucene search. I will get the location name from table location and search against the Lucene index using keyword query.

I found lots of matched because of the term "city". So decided to change it phrase search. phrase search like "Kansas city, mo" this, but I found no result. So I realized I want to search the "Kansas city" against keyword "Kansas city, mo". Is that possible to do reverse search or anyway to do relationship with location table index and find the country code.

Show more