Search code examples
search-engine

is there an algorithm to find out which words in a search-string belong together?


I was thinking about text driven search by user input. often you are searching in a database of addresses, where you can find customers and so on.

has anybody any idea how to find out which of the typed words is the name, which is the street name, which is the company name? and secondly if the name is a double name like "Lee Harvey", how can I find out that the two words Lee and Harvey belong together? Same problem with company names like "frank the baker inc."...

Is there any algorithm or best practice strategy? thanks for links, tutorials, scripts and all other help ;-)


Solution

  • Don't care, just perform full-text search. Then you should check the result items for which field contains the search terms. Also, you may display items in separate lists (terms found int name, term found in address). The only difficulty is if John Smith is living in the John Smiht street, you must decide, which list/lists the result item belongs to.