I need to know if there is a efficient way to differentiate keyword search results between 2 flatdbs. I have been blessed to have jarich help split filehandles and assign them to arrays to hold data until needed later. However, earlier on I find I need to differentiate search results.

These are my placeholders

$main_template =~ s/%%keywords%%/$fields{'keywords'}/g; $main_template =~ s/%%searcresults%%/$pitem/g; $main_template =~ s/%%keywords%%/$fields{'keywords'}/g; $main_template =~ s/%%premiumlistings%%/$premiumitem/g;
I need to differentiate between ~ s/%%keywords%%/$fields{'keywords'}/g; for the %%searcresult%% and %%premiumlistings%%
$fields{'keywords'} = &get_search_ready($fields{'keywords'}); if ($fields{'keywords'} eq ""){$fields{'keywords'} = "NOTHING";} if (length($fields{'keywords'}) < $minimum_keyword_length){$fields{'ke +ywords'} = "2_CHARS";} if (($use_mysql eq "Yes") and ($fields{'keywords'} ne "NOTHING") and ( +$fields{'keywords'} ne "2_CHARS")) { &mysql_search; } elsif (($fields{'keywords'} ne "NOTHING") and ($fields{'keywords'} + ne "2_CHARS")) { &normal_search; } if (($fields{'keywords'} eq "NOTHING") or ($fields{'keywords'} eq "2_C +HARS")) { $fields{'keywords'} = ""; } #### RELEVANCE $rspcntr = 0; ############ CAPTURES ALL KEYWORD INPUT ############### (@skeyw) = split(/ /,$fields{'keywords'}); ########### ADDED 04/29/04 ################### $nrkeywords = push(@skeyw); foreach $kwrel (@resultline) ########################################### { $keycount = 0; $kwcntr = 1000; while ($keycount < $nrkeywords) { #### TITLE (@litems) = split(/\t/,$kwrel); if ($litems[1] =~ /$skeyw[$keycount]/i) { $kwcntr = $kwcntr - 5; } #### DESCRIPTION if ($litems[2] =~ /$skeyw[$keycount]/i) { $kwcntr = $kwcntr - 1; } #### KEYWORDS if ($litems[5] =~ /$skeyw[$keycount]/i) { $kwcntr = $kwcntr - 4; } ##### GENERAL if (($kwrel =~ /$skeyw[$keycount]/i) and ($skeyw[$keycount] +ne "")) { $kwcntr = $kwcntr - 1; } ##### PHRASE if (($kwrel =~ /$fields{'keywords'}/i) and ($nrkeywords > 1) +) { $kwcntr = $kwcntr - 10; } ##### AND BOOLEAN MATCHING if ($nrkeywords == 2) { if (($kwrel =~ /$skeyw[0]/i) and ($kwrel =~ /$skeyw[1] +/i)) {$kwcntr = $kwcntr - 20;} } elsif ($nrkeywords == 3) { if (($kwrel =~ /$skeyw[0]/i) and ($kwrel =~ /$skeyw[1] +/i) and ($kwrel =~ /$skeyw[2]/i)) {$kwcntr = $kwcntr - 30;} } elsif ($nrkeywords == 4) { if (($kwrel =~ /$skeyw[0]/i) and ($kwrel =~ /$skeyw[1] +/i) and ($kwrel =~ /$skeyw[2]/i) and ($kwrel =~ /$skeyw[3]/i)) {$kwcntr = $kwcntr - 40;} } $keycount++; } if (length($kwcntr) == 3){$kwcntr = "0" . $kwcntr;} if (length($kwcntr) == 2){$kwcntr = "00" . $kwcntr;} if (length($kwcntr) == 1){$kwcntr = "000" . $kwcntr;} $resultline[$rspcntr] = $kwcntr . "-_:" . $kwrel;

If not, is there a way to add multiple names (inferences) to the search input text field so I may separate 'keywords' from 'keywords2' to differentiate the %%searchresults%% placeholder from the %%premiumlistings%% placeholder doring the same search process?

Example: http://www.urhosted.com/mall/searchres.html - template before populated

then search for "store"


In reply to Separating multiple keyword search input by Dente

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.