becu Posted September 12, 2008 Share Posted September 12, 2008 Hi, I'm trying to write a search function for my site. Let say a user input "my lovely dog", then if my site has an article let say: "my cute lovely but not very friendly doggy" -> then there's a match. but if my site has an article: "my friendly doggy lovely" -> then my search can't find this article. My question is how do you swap input text, so that it doesn't matter what order the users input, it can always find matched article. my above sample would be: my lovely dog, dog my lovely, lovely dog my...will be matched with an article entitled "my cute lovely but not very friendly doggy". Thanks. Link to comment https://forums.phpfreaks.com/topic/123989-mysql-search/ Share on other sites More sharing options...
fenway Posted September 12, 2008 Share Posted September 12, 2008 Intelligent full-text searches are very poorly supported by native mysql -- look at sphinx or lucene. Link to comment https://forums.phpfreaks.com/topic/123989-mysql-search/#findComment-640150 Share on other sites More sharing options...
becu Posted September 12, 2008 Author Share Posted September 12, 2008 fenway, I don't own the server. I just need an okay search method for now. I guess this is more of a PHP question. let say I have an array of 3, 4 elements. Can you propose an algorithm to swap elements and get all possible arrays from this one array? $arr = array("a", "b", "c"); ==> I want (a, b, c) (a, c, b) (c, a, b) (c, b, a) (b, a, c) (b, c, a) thanks. Link to comment https://forums.phpfreaks.com/topic/123989-mysql-search/#findComment-640190 Share on other sites More sharing options...
fenway Posted September 13, 2008 Share Posted September 13, 2008 You mean like this? Link to comment https://forums.phpfreaks.com/topic/123989-mysql-search/#findComment-640256 Share on other sites More sharing options...
becu Posted September 13, 2008 Author Share Posted September 13, 2008 fenway, I can't access the page you gave. can you double-check the url? thanks for your help! Link to comment https://forums.phpfreaks.com/topic/123989-mysql-search/#findComment-640781 Share on other sites More sharing options...
becu Posted September 15, 2008 Author Share Posted September 15, 2008 any ideas guys? thanks. Link to comment https://forums.phpfreaks.com/topic/123989-mysql-search/#findComment-641753 Share on other sites More sharing options...
fenway Posted September 15, 2008 Share Posted September 15, 2008 fenway, I can't access the page you gave. can you double-check the url? thanks for your help! Sorry -- I found that here. Link to comment https://forums.phpfreaks.com/topic/123989-mysql-search/#findComment-641976 Share on other sites More sharing options...
becu Posted September 17, 2008 Author Share Posted September 17, 2008 Thanks fenway, I will dig into it. Link to comment https://forums.phpfreaks.com/topic/123989-mysql-search/#findComment-643539 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.