Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 01:31:48 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
149639 Posts in 21099 Topics by 7538 Members
Latest Member: ionline
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: No search results for detail pages  (Read 1549 times)
freeSbee

Offline Offline

Posts: 729


WWW
« on: December 07, 2007, 08:47:08 PM »

Hello

Using a module like Image Gallery or GoCart (and others as well) I don't get the search results I am expecting.

For example:

If I am looking for a word that is located in the DESCRIPTION of an image the search results will show the gallery page name with a link to the page (e.g. pages/image-gallery.php) So far so good.

But if I am looking for a word that is located in the FULL DESCRIPTION of the same image the search results will show the same page with the same link (e.g. pages/image-gallery.php) again.
Unfortunately the full description containing the search word is not displayed on this overview page!

In this case WB should show the detail page or name of the item and a link to the item (e.g. pages/gallery/woudpecker4.php) instead of the overview page.

Does anybody know a workarround?
Can it be done by changing the value field of the query_body row only?
Or has the file search/search.php to be modified to handle items?

Best, Christoph
Logged
doc
Guest
« Reply #1 on: December 08, 2007, 06:50:43 AM »

Hello,

it is up to the module authors to include search phrases to the WB search table. So if the module itself does not add e.g. image description to the search table, WB will not find and display it.

Have a look to the Hello world module, which adds the output of the text to the search table of WB. This is what you need to add to the modules you want.

Regards Christian
« Last Edit: December 08, 2007, 09:57:07 AM by doc » Logged
ruebenwurzel
WebsiteBaker Org e.V.

Online Online

Posts: 7662



WWW
« Reply #2 on: December 08, 2007, 08:20:21 AM »

Hello,

@freeSbee
please have a look to this page here:

http://nettest.thekk.de/

As i know you are know a little bit aboout php  grin, i think you understand the code from thorn. My personal opinion is that this search function and the result page should be a must in one of the next WB versions. As there are database changes necessary it will not be in the 2.6.x versions. But i think with your knowledge you can adapt your existing version and the modules you wanna have searchable. For a few of them the fixes are already ready.

Matthias
Logged
freeSbee

Offline Offline

Posts: 729


WWW
« Reply #3 on: December 08, 2007, 11:54:03 AM »

Hello,

@Christian & @ Matthias
Thanks for your answers!


@Christian
My way of pointing out the problem was rather complicated and maybe mistakable.

The point was not to in- or exclude parts of module tables to the search but to provide a direct link from the search result page to e.g. the matching image (image gallery) or the matching item (gocart).


@ Matthias
This is perfect!
Thanks a lot for the hint and special thanks to thorn!
I will test it right now!


@Christian & @ Matthias
Yet there is another point I am confused about:

In some of the modules it is possible to search the settings table. This makes no sense to me. Is there any reason for this?

Problem: Searching for the word "text" returns a match from the news module even though the  word "text" makes not part of any posts. But it makes part of the settings e.g. in the <style> tag:
   .post_date { text-align: right; }
Worse that it screws up the style definition by setting a <span> tag into the css:
   .post_date { <span class="highlight">text</span>-align: right; }


Best, Christoph

« Last Edit: December 08, 2007, 11:56:58 AM by freeSbee » Logged
ruebenwurzel
WebsiteBaker Org e.V.

Online Online

Posts: 7662



WWW
« Reply #4 on: December 08, 2007, 12:31:07 PM »

Hello,

Quote
Problem: Searching for the word "text" returns a match from the news module even though the  word "text" makes not part of any posts. But it makes part of the settings e.g. in the <style> tag:
   .post_date { text-align: right; }
Worse that it screws up the style definition by setting a <span> tag into the css:
   .post_date { <span class="highlight">text</span>-align: right; }

Can you post this to thorn? He is the searching guru and developped the exisiting and (as you see on his page) the future version of WB searching.

Matthias
Logged
thorn

Offline Offline

Posts: 980


WWW
« Reply #5 on: December 08, 2007, 08:35:57 PM »

Hello,

but to provide a direct link from the search result page to e.g. the matching image (image gallery) or the matching item (gocart).
This isn't possible with the current search-routines from 2.6.7. That's because you get a bunch of results, but you can't see where the match occurred (from the programmers side of view).

Quote
In some of the modules it is possible to search the settings table. This makes no sense to me. Is there any reason for this?
not really  tongue

Quote
Worse that it screws up the style definition by setting a <span> tag into the css:
   .post_date { <span class="highlight">text</span>-align: right; }
this is a weakness of the used regex
To fix this you have to alter one line in framework/frontend.functions.php
replace:
Code:
$foo = preg_replace('/('.$string.')(?=[^>]*<)/iUS', '<span class="highlight">$1</span>',$foo);
with:
Code:
removed
EDIT: once again, php's limitations (stack-memory exceeded with complex regex) killed this one  angry

thorn.
« Last Edit: December 27, 2007, 10:14:57 PM by thorn » Logged

thorn

Offline Offline

Posts: 980


WWW
« Reply #6 on: December 30, 2007, 12:47:39 PM »

Hello,

This problem is fixed in the new release on http://nettest.thekk.de
There are too much limitations in PHP's regex-handling, so i did it the good old way - splitting the content into pieces. So i put the '<style...' and '<script...' out of the way.

thorn.
« Last Edit: December 30, 2007, 12:49:58 PM by thorn » Logged

Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!