Gossamer Forum
Home : Products : DBMan : Customization :

Search Results Return

Quote Reply
Search Results Return
I have already applied this change...
http://www.gossamer-threads.com/scripts/resources/Detailed/1035.html

My addrecord has 4 text entry fields where users paste huge text files with different bits of info per line. I wish to have the results from a search only display the lines that the query matched, instead of the entire contents of the field with the lines that matched in bold. I hope I am explaining that properly. I looked for a mod and in the faq and I didn't see anything pertaining to this customization. Is this possible without severe code hacking? Thanks in advance...

-Lucid

Quote Reply
Re: Search Results Return In reply to
I examined the code and I can't seem to find a way. If someone could just point me in the right direction it would help tons. Thanks again.

Quote Reply
Re: Search Results Return In reply to
Is it that I am not clear on what I want to do or that it's impossible? I don't know why this hasn't been asked before, no one wants to see someone's entire listing if it's a huge text field and they only want a few lines...

Quote Reply
Re: Search Results Return In reply to
=( It would really be helpful if someone figured this out.

Quote Reply
Re: Search Results Return In reply to
Just so you get a response, I will say that of the many many threads I have been through in the support forum, I have not seen this question asked or answered.

I'm not sure if it is possible, but I could be wrong.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Search Results Return In reply to
Are you doing a keyword search or can people actually search on the field? Or are both possible?

And, are there carriage returns within the text field or does it just word-wrap on the page?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Search Results Return In reply to
Any search or keyword search returns the entire field, with carriage returns, not word wrap. All information added shows up, and in bold are what the search query matched. I am trying to get it to show just the line that the search query matched, and not the entire huge list. like say they searched for "blue" in the colors box, it would return...

Search Results...
Name: Lucid
ICQ: 16454199
Favorite Day of the Week: Saturday
Favorite Colors: aqua
red
orange
yellow
blue
violet
light blue
green
purple
blueish green
black
white

The entire listing, and just the results in bold... What I want it to display is..

Name: Lucid
Favorite Colors: blue
light blue
blueish green


Quote Reply
Re: Search Results Return In reply to
What I was asking is how searches are being done and how your field is set up. But I think I can figure it out from what you wrote.

In sub html_record, add

Code:

|;
@text_lines = split /\n/,$rec{'FieldName'};
$term = $in{'FieldName'} || $in{'keyword'};
if ($term) {
foreach $text (@text_lines) {
if ($text =~ /$term/) {
print "$text<BR>\n";
}
}
}
print qq|
If you have added a line to sub html_record -- $rec{'FieldName'} =~ /\n/<BR>/s;, take that line out.

It occurred to me that this will cause some problems in the "add success" and "modify success" pages. You might want to have a separate subroutine for search results.

JPD
http://www.jpdeni.com/dbman/