|
09-06-2003, 07:05 PM | #1 |
Green Mole
Join Date: Sep 2003
Posts: 5
|
OR functionality
I just discovered phpDig and it seems great but I have not really looked at the internal code yet. How hard would it be to add "OR" functionality to phpDig? I'm assuming it would be quite difficult seeing that it is not already part of the functionality.
|
09-07-2003, 07:39 AM | #2 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
As of MySQL 4.0.1, FULLTEXT boolean searches can be done using the IN BOOLEAN MODE modifier. At http://www.mysql.com/doc/en/Fulltext_Search.html there is a list of boolean operators available with MySQL 4.0.1+.
For those using MySQL 3.XX.XX, David Altherr wrote some boolean functions for use with MySQL 3.23.23+. Attached is a ZIP of these functions, which David has released for free under the MIT open source license.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
11-19-2003, 01:00 PM | #3 |
Orange Mole
Join Date: Nov 2003
Posts: 69
|
The current version of PhpDig doesn't use the MySQL FULLTEXT capabilities, am I right?
Why not?
__________________
René Haentjens, Ghent University |
11-19-2003, 09:01 PM | #4 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. Yes, you are correct. PhpDig stores keywords and uses those keywords to pull search results from relevant text files. More information about using a FULLTEXT index can be found here.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
11-24-2003, 02:41 AM | #5 |
Orange Mole
Join Date: Nov 2003
Posts: 69
|
The article you refer to is interesting, thank you.
It concludes with the following words: "For many applications, boolean searches are one of MySQL 4's most useful features. With careful use, you can save yourself substantial of development time, and add many useful enhancements." So, my question remains open: why doesn't PhpDig make use of this capability?
__________________
René Haentjens, Ghent University |
11-24-2003, 06:45 AM | #6 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. The MATCH AGAINST capabilites were introduced in the MySQL 3.23.23 version, do not allow for partial word matching, and exclude results where keyword can be found in over half of the rows. The IN BOOLEAN MODE capabilites were introduced in MySQL 4.0.1 and are not available in MySQL 3.23.x versions. MySQL 4.0.x reached production level in the spring of 2003, and there are many users who still utilize MySQL 3.23.x versions. PhpDig was written to store keywords and use those keywords to pull results from text files. This circumvents certain limits with MATCH AGAINST queries and avoids using LIKE queries on pages of text. When MySQL 4.x.x becomes the standard package for all MySQL users, PhpDig would need major changes in order to make use of IN BOOLEAN MODE capabilities.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
11-27-2003, 06:11 AM | #7 |
Orange Mole
Join Date: Nov 2003
Posts: 69
|
Clear and to the point. Thank you.
From the MySQL documentation that I have seen, it is not clear to me whether the following limitations also apply IN BOOLEAN MODE: - words of 3 letters are not taken into account; - words are composed of letters, digits, hyphens and underscores and this cannot be customized easily. PhpDig considers words as composed of letters, digits, points, hyphens, underscores, ampersands and slashes isn't it? And as it is open source, I guess it must not be hard to change that? Has anyone tried to compare the indexing and/or searching speed of PhpDig's keyword method against using MySQL 4's FULLTEXT + IN BOOLEAN MODE?
__________________
René Haentjens, Ghent University |
11-28-2003, 03:57 AM | #8 |
Green Mole
Join Date: Sep 2003
Posts: 15
|
I would like to say something with respect to the information that Carter mentioned, that the way that phpdig stores keywords in the datbase and so on limits the search functionality. That is not really true.
Actually we had the same problem (need of OR or even full text search queries) and came to the point to skip the (sorry for that) anyway unflexible search front-end of phpdig and to query the database directly. This works great and with the content-text files we realized a full text search. |
11-28-2003, 04:12 AM | #9 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. Hmm, I don't think I said that the method PhpDig uses to store keywords limits search functionality.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
11-28-2003, 04:33 AM | #10 |
Green Mole
Join Date: Sep 2003
Posts: 15
|
Well first of all sorry for misspelling your name, Charter. Secondly sorry for calling your name, but it was meaned to be instead of everybody who started discussing about database versions, when someone asked for an OR-connected search via the engine.
|
11-28-2003, 04:36 AM | #11 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. There's no reason to be sorry.
Yes, something can be programmed to get OR functionality.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
12-20-2003, 05:49 PM | #12 |
Purple Mole
Join Date: Dec 2003
Posts: 106
|
Hi there -
I'm also very interested in getting PhpDig to support the "OR" function. Would someone be willing to post the code changes necessary in search_function.php that would allow this? I'm willing to write my own code but I'd like somewhere to start if someone's already done this, rather than re-inventing the wheel so to speak. Thanks!
__________________
Foundmyself.com artist community, art galleries |
01-02-2004, 03:14 PM | #13 |
Purple Mole
Join Date: Dec 2003
Posts: 106
|
I'm a newbie so I guess this function has already been implemented? I see in the 1.6.5 demo that OR works, but on my site it doesn't. Could this be due to an older version of MySQL? If so it'd be nice to know so I can update. Thanks for the help.
__________________
Foundmyself.com artist community, art galleries |
01-02-2004, 08:08 PM | #14 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. The online demo uses "and operator - exact words - or operator" searching options, and this is currently in beta. The PhpDig 1.6.5 package uses "words begin - exact words - any words part" searching options. Visit here to try the "and operator - exact words - or operator" searching options with PhpDig 1.6.5.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
01-03-2004, 09:01 AM | #15 |
Purple Mole
Join Date: Dec 2003
Posts: 106
|
Thanks a lot, it works great so far. Good luck with the next version.
__________________
Foundmyself.com artist community, art galleries |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Exact Phrase functionality | siliconkibou | How-to Forum | 2 | 01-09-2004 03:26 PM |