reverse phrase search in zend lucene

六眼飞鱼酱① 提交于 2020-01-05 08:27:56

问题


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

City

country_code   city_name
US             Kansas city
.........
(thousands of world country cities) 

Location table

Location

location_name
Kansas city, mo
Kansas city
Kansas city, us
uSA, Kansas city
etc...

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.

来源:https://stackoverflow.com/questions/17655676/reverse-phrase-search-in-zend-lucene

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!