feha Posted February 15, 2008 Share Posted February 15, 2008 I wonder if there is a reg-ex solution for this type of rules: Example: Supports: AND OR NOT ( ) and phrases surrounded with double quotes "like this" - nesting is supported - spaces between keywords will default to AND. This would save lot of time to get right MySQL query syntax. Any tips appreciated, thank you. Quote Link to comment Share on other sites More sharing options...
effigy Posted February 15, 2008 Share Posted February 15, 2008 I'm confused. Can you clarify with examples? Quote Link to comment Share on other sites More sharing options...
feha Posted February 15, 2008 Author Share Posted February 15, 2008 Hi effigy Here is one live example of checking search rules: http://www.digitalstratum.com/oss/fts_parser_test There are many php functions on his class ... can these rules be checked with reg-ex ? thank you Quote Link to comment Share on other sites More sharing options...
effigy Posted February 15, 2008 Share Posted February 15, 2008 Yes, but depending on what you're doing and how much, it's best to use a combination of methods. This would save lot of time to get right MySQL query syntax. What do you mean by this? You can do this in MySQL: http://devzone.zend.com/node/view/id/1304 Quote Link to comment Share on other sites More sharing options...
feha Posted February 15, 2008 Author Share Posted February 15, 2008 Hello again Yes i know about the full text "natural" search feature ... I wanted to make a parser without altering a table ... ADD FULLTEXT () ... etc I think such reg-ex is almost impossible :-) Second alternative would be ALTER tables and add full text feature , much faster solution + get relevance Thank you for your tips and great answer. Quote Link to comment Share on other sites More sharing options...
effigy Posted February 15, 2008 Share Posted February 15, 2008 The patterns to do so shouldn't be that difficult, but it would be folly considering that MySQL has it built in, thus making it much more efficient. Quote Link to comment Share on other sites More sharing options...
feha Posted February 15, 2008 Author Share Posted February 15, 2008 You are right. The better way is to use built-in feature of MySQL less headache :-) Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.