Is there a way that the search result return the result like Google, that the description display the word that was search, and it return just the sections that contain this word
Jun 4, 2009, 2:53 AM
Veteran / Moderator (18441 posts)
Jun 4, 2009, 2:53 AM
Post #2 of 16
Views: 9832
Mmm, not easily (especially if they are using more than one word to search for)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Jun 4, 2009, 3:00 AM
Veteran / Moderator (18441 posts)
Jun 4, 2009, 3:00 AM
Post #4 of 16
Views: 9889
All that does, is a simple regex to find the word, and match highlight it (using a simple <font>)
To do what you want, it would have to do more complex stuff - like finding the word first, and then adding say 5 words before/after the keyword - and then add some ...) . Sounds simple - but its not particually easy :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
To do what you want, it would have to do more complex stuff - like finding the word first, and then adding say 5 words before/after the keyword - and then add some ...) . Sounds simple - but its not particually easy :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Aug 6, 2010, 12:36 PM
Veteran / Moderator (6956 posts)
Aug 6, 2010, 12:36 PM
Post #5 of 16
Views: 9566
nir wrote:
Is there a way that the search result return the result like Google, that the description display the word that was search, and it return just the sections that contain this wordThe first thing that jumped into my mind was a regex that would match n-words/keyword/n-words ... but not being especially handy with that (where's paul when you need him?), I went looking. And looking. And looking. I found some really, really convoluted ideas, which made me start to doubt my original idea that it could be a simple regex, then realized they were all on php forums ;)
I found a couple of potential CPAN modules,
http://search.cpan.org/.../lib/Text/Context.pm
http://search.cpan.org/...rch/Tools/HiLiter.pm
But they were not exactly what people are asking for, and were kind of klunky for such an apparantly simple job.
Also this "Context Grep" idea (searches on that didn't reveal more, unfortunately)
http://www.pre-emptive.net/doco/context-grep-perl
And then this article on StackOverflow, that is pretty much close to what had jumped into my head, but the code is unfinished.
http://stackoverflow.com/...n-the-search-results
Code:
if ($text =~ /((\S+\s+){0,4})($search)((\s+\S+){0,4})/i) { my ($pre, $match, $post) = ($1, $3, $4);
...
}
Quote:
...to suggest using @+ and @- to avoid the performance penalty imposed by $ and #' -Maybe someone can use that page as a starting point for a piece of finished code?
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Aug 6, 2010, 2:20 PM
Enthusiast (559 posts)
Aug 6, 2010, 2:20 PM
Post #6 of 16
Views: 9552
I don't know if this is a related query but I find that the built-in user side search requires exact search terms whereas the admin side search is a little more forgiving.
For example, if I have a product called First ABC-123 it won't show in the results if a user types ABC123 but it will if they type ABC-123. Google search results on the other hand do account for this and will return results for both on a single query.
I have a lot of searches in the log that show 0 results, even though a product is listed, simply because the search term wasn't exact.
For example, if I have a product called First ABC-123 it won't show in the results if a user types ABC123 but it will if they type ABC-123. Google search results on the other hand do account for this and will return results for both on a single query.
I have a lot of searches in the log that show 0 results, even though a product is listed, simply because the search term wasn't exact.
Aug 6, 2010, 11:49 PM
Veteran / Moderator (18441 posts)
Aug 6, 2010, 11:49 PM
Post #7 of 16
Views: 9543
One possible solution for that, is to add a new field - and then make that contain the possible "mis-spellings" of the title etc ... thats what I've done before
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Aug 7, 2010, 3:55 AM
Veteran / Moderator (18441 posts)
Aug 7, 2010, 3:55 AM
Post #9 of 16
Views: 9609
Just add it via Links > Properties > Add Column .. .something like:
Title_Alternative CHAR(255)
Depending on how your search is setup, it should just find them automatically :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Title_Alternative CHAR(255)
Depending on how your search is setup, it should just find them automatically :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Aug 7, 2010, 4:18 AM
Veteran / Moderator (18441 posts)
Aug 7, 2010, 4:18 AM
Post #11 of 16
Views: 9629
Hi,
Is it just a case of removing the - from the titles? Just to get you started? If so, its a piece of cake with a few SQL queries :)
...and then:
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Is it just a case of removing the - from the titles? Just to get you started? If so, its a piece of cake with a few SQL queries :)
Quote:
UPDATE glinks_Links SET Title_Alternative = Title;...and then:
Quote:
UPDATE glinks_Links SET Title_Alternative = REPLACE(Title_Alternative,"-","");Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Aug 7, 2010, 11:15 PM
Veteran / Moderator (18441 posts)
Aug 7, 2010, 11:15 PM
Post #15 of 16
Views: 9592
I would imagine ", " seperated would be your best option (otherwise the search code may start brining up weird results)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Aug 9, 2010, 12:23 AM
User (434 posts)
Aug 9, 2010, 12:23 AM
Post #16 of 16
Views: 9495
Hi,
I wanted to put it in a thread of its own but I think it makes sense to point you to the new thread:
http://www.gossamer-threads.com/.../?page=unread#unread
Regards
Niko
I wanted to put it in a thread of its own but I think it makes sense to point you to the new thread:
http://www.gossamer-threads.com/.../?page=unread#unread
Regards
Niko