PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 02-23-2004, 05:44 AM   #1
witness
Green Mole
 
Join Date: Feb 2004
Posts: 7
apostrophe

Salut, j'ai quelques interrogations face aux apostrophes dans phpDig. Comment fonctionnent-t-ils?

Par exemple, j'ai une phrase qui dit "Un peu d'histoire",
Si je recherche "histoire", phpDig ne me retourne aucun résultat, mais si je cherche "d'histoire", j'ai un résultat.

Je sais qu'en anglais, les apostrophes ne sont pas vraiment un problème, mais en français dieu sait qu'il y en a beaucoup!

J'apprécie vraiment toute votre aide.

Merci.
witness is offline   Reply With Quote
Old 02-23-2004, 10:13 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. For the phrase "Un peu d'histoire" PhpDig version 1.8.0 treats d'histoire as one word so it finds a result. However, when searching on histoire, and assuming the page text does not contain histoire but does contain d'histoire, PhpDig will not return a result. This is because the apostrophe is allowed and LIKE "keyword%" is used in the search query so histoire does not match d'histoire.
__________________
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.
Charter is offline   Reply With Quote
Old 02-23-2004, 10:41 AM   #3
witness
Green Mole
 
Join Date: Feb 2004
Posts: 7
Thanks Charter.

Is there any way that I can change this?
Like maybe put LIKE "%keyword%"? Because apostrophes in french are pretty current so I can't have important words not come out because of them.

I'd appreciate any help.

Thanks.
witness is offline   Reply With Quote
Old 02-23-2004, 11:59 AM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. You could try the %keyword% approach in the search_function.php file by editing the $like_start, $like_end, and/or $like_operator variables, but %keyword% queries can be slow. You could also try removing the escaped apostophe from the $text variable in the phpdigEpureText function of the phpdig_functions.php file and from the $what_query_chars variable in the phpdigSearch function of the search_function.php file, and then do a reindex. If you do the latter, then you may need to edit the exact phrase portion so that phrases with an apostrophe are found. If your database tables are not large, perhaps the former method would be sufficient if not too slow.
__________________
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.
Charter is offline   Reply With Quote
Old 02-23-2004, 12:07 PM   #5
witness
Green Mole
 
Join Date: Feb 2004
Posts: 7
I'm trying it right now!

Last edited by witness; 02-23-2004 at 12:26 PM.
witness is offline   Reply With Quote
Old 02-23-2004, 12:37 PM   #6
witness
Green Mole
 
Join Date: Feb 2004
Posts: 7
Sorry i've tried (both files), but it doesn't seem to work.

What do you mean by "edit the exact phrase portion"?

[Also, is there any reason why, even though I select ANY in the form, phpDig takes the query string and searches for it at the beginning?

i.e. if i am searching "rative" and i know that the word "figurative" exists, why does it not find any results??]

Thanks

Last edited by witness; 02-23-2004 at 01:27 PM.
witness is offline   Reply With Quote
Old 02-23-2004, 02:34 PM   #7
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
>> Sorry i've tried (both files), but it doesn't seem to work.

Hi. Did you reindex after removing the escaped slash in those two places? Try indexing a demo page after making the changes and see what turns up in the seach results for words with/without the apostrophe.

>> What do you mean by "edit the exact phrase portion"?

The exact phrase code in PhpDig version 1.8.0 may need to be edited to work with any apostrophe related changes in the code.

>> Also, is there any reason why, even though I select ANY in the form, phpDig takes...

If you are using PhpDig 1.8.0, the language pack needs to be edited to reflect "and operator - exact phrase - or operator" instead of what you see onscreen. PhpDig 1.6.5 allows for "any" but PhpDig 1.8.0 uses LIKE "keyword%" queries, as LIKE "%keyword%" queries can be slow.

The Changelog has a list of differences/updates between versions. Maybe try editing the search_function.php file to have LIKE "%keyword%" queries and check the search times.
__________________
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.
Charter is offline   Reply With Quote
Old 02-24-2004, 04:08 AM   #8
witness
Green Mole
 
Join Date: Feb 2004
Posts: 7
I've re-tried the 2file-solution and am happy to report that everything seems to be working well.

Thank you very much Charter! Your help and quickness in response are greatly appreciated!
witness is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:14 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.