Page 1 of 1
Contents search widget
#1
Posted 15 May 2009 - 04:05 AM
So, you may add the contents search widget to the blog demo as follows. Here is the diff.
http://code.google.c...rce/detail?r=19
Actually, though this is the enhancement of the yii-blogdemo-enhanced, it can be applied to the original blog demo because this does not related to other enhancements much.
http://code.google.c...rce/detail?r=19
Actually, though this is the enhancement of the yii-blogdemo-enhanced, it can be applied to the original blog demo because this does not related to other enhancements much.
#2
Posted 16 May 2009 - 07:15 PM
Quote
Actually, though this is the enhancement of the yii-blogdemo-enhanced, it can be applied to the original blog demo because this does not related to other enhancements much.
I have confirmed this. BTW, as I have raised the discussion on a bug as follows, please be careful. I surely am going to fix it.
http://www.yiiframew...pic,2182.0.html
#4
Posted 18 May 2009 - 08:37 AM
Very Good. I am just about to add my tip on how to add search capability.
#5
Posted 18 May 2009 - 08:28 PM
Sorry but it may be incomplete. :'( I am searching right way to resolve it.
#6
Posted 25 May 2009 - 11:52 PM
I think I was able to fix the bug. You can see the diff at the google code, but I can show the code central for your reference.
http://code.google.c...rce/detail?r=20
protected/controllers/PostController.php:
http://code.google.c...rce/detail?r=20
protected/controllers/PostController.php:
#7
Posted 09 June 2009 - 11:14 PM
New release. 
I have added the enhancement of high-lighting the searched words. It is better seeing than reading this explanation. Try out this enhanced blog demo, or even simple blog with search.
I have added the enhancement of high-lighting the searched words. It is better seeing than reading this explanation. Try out this enhanced blog demo, or even simple blog with search.
#9
Posted 28 June 2009 - 12:48 AM
Just want to say: you are so helpful with your examples/demos
Thank you.
Thank you.
#11
Posted 11 July 2009 - 09:07 AM
Won't formatting break the searching? If you have a single post with the content
and you search for "something unexpected", I suppose there won't be any match because of the formatting.
It'd be better, if non-word characters were acceptable between search keywords in my opinion.
Yet there will be questions without answers, because if you had a post something like
and you were looking for "external site", searching would not return this post either.
(You probably want to search in pure markdown text, but the case is not different in it either.)
I'm looking forward to hearing your opinion.
something *unexpected*
and you search for "something unexpected", I suppose there won't be any match because of the formatting.
It'd be better, if non-word characters were acceptable between search keywords in my opinion.
Yet there will be questions without answers, because if you had a post something like
pointing to an <a href="http://example.com">external</a> site
and you were looking for "external site", searching would not return this post either.
(You probably want to search in pure markdown text, but the case is not different in it either.)
I'm looking forward to hearing your opinion.
#12
Posted 12 July 2009 - 10:54 PM
Hi pestaa,
I actually had a trouble with markdown languages as you mentioned. At first I tried to search the words in Post.content, but changed my mind to search in Post.contentDisplay with this reason. And I added the functionality to ignore the contents in the tags starting with '<' and ending with '>'. This is the current algorithm. Do you think you may have a better idea?
I actually had a trouble with markdown languages as you mentioned. At first I tried to search the words in Post.content, but changed my mind to search in Post.contentDisplay with this reason. And I added the functionality to ignore the contents in the tags starting with '<' and ending with '>'. This is the current algorithm. Do you think you may have a better idea?
#13
Posted 13 July 2009 - 03:24 AM
Your solution is fairly good, although I can still think of an edge case.
Let's assume we have
in our post, now if we tried to search for "dash between", won't this script find anything, will it?
Thus I still recommend to accept nonword characters between keywords.
Let's assume we have
dash - between
in our post, now if we tried to search for "dash between", won't this script find anything, will it?
Thus I still recommend to accept nonword characters between keywords.
Share this topic:
Page 1 of 1

Help













