Splitting a string into multiple parts
622829Mar 13 2008 — edited Mar 14 2008I'm working on search functionality for my site right now. I want to be able to support partial matches as well, and have the results returned so that whole phrase matches show up at the top, followed by partial matches.
I figure the best way is to do a search on the whole phrase, and give the results a weight of 1. Then I wanted to see if any of the individual words (in case of a multiple word search phrase) in a search phrase come up and if so, give them a weight of 2.
I guess my first question is, that if someone wants to do a search on the phrase "atlanta falcons bars", how do I determine that there are 3 words, and then split them up into 3 separate variables? I can't seem to find any PL/SQL functions to help me with this.
I figure that I should be looking for a " " in the search term, and use that to split up the search term up. I know in PHP I would use something like the explode() function, but I can't find something similar in PL/SQL.