Results 1 to 10 of 10

Thread: power search doesn't search certain cats

  1. #1
    Join Date
    Sep 2002
    Posts
    60

    Default power search doesn't search certain cats

    Hi,

    Why does the power search form not show up links in its results when you are searching a category that is either the second or third choice category for the link?

    I.E

    A link is submitted to cat 1, cat 2 and cat 3 in that order.

    I seach cat 1 and the link shows up, i search cat 2 and cat 3 and the link doesn't show up.

    Any ideas why this doesn't work?

    I've used both the dynamic category menu generated by indexu and a custom built one and neither work properly.

    I've noticed that the number of links doesn't pick up the second and third cat either, i'm guessing that indexu doesn't recognise the secondary and third categories that a link is submitted to.

    Please somebody tell me i'm wrong, i've just started to advertise the site at some $$$$$$$$$ to find an integeral part of the service doesn't work.

    If you want to try it go to...

    http://www.eprojx.co.uk/directory/power_search.php

    Search the web design : england : midlands category and there should be 1 link showing up. Ignore the other vairables they are only there to narrow the search.

    Thanks

    Rob

  2. #2
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    when they addd the "multiple categories" to INDEXU, they forgot the power search

    here is what it looks like in power_search.php

    if($field=='category_id' && !empty($cat)) {
    $j=0;
    $query .= "and ($field = $cats[$j] ";
    while($j<$num_cats) {
    $query .= "or $field = $cats[$j] ";
    $j++;
    }
    $query .= ") ";
    }

    you would probably need to add something similar for each of the two add'l categories changing category_id to cat1 and cat2, if I recall the names correctly.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  3. #3
    Join Date
    Sep 2002
    Posts
    60

    Default

    From the looks of it there were quite a few bugs with the latest release, and there was me thinking it was fantastic! ha ha

    is this along the rite lines, or am i totally off the pace?

    if(!empty($HTTP_POST_VARS["title"])) $title = $HTTP_POST_VARS["title"];
    else $title = $HTTP_GET_VARS["title"];

    if(!empty($HTTP_POST_VARS["cat"])) $cat = $HTTP_POST_VARS["cat"];
    else $cat = $HTTP_GET_VARS["cat"];

    if($field=='category_id' && !empty($cat)) {
    $j=0;
    $query .= "and ($field = $cats[$j] ";
    while($j<$num_cats) {
    $query .= "or $field = $cats[$j] ";
    $j++;
    }
    $query .= ") ";
    }

    elseif($field=='cat1' && !empty($cat)) {
    $j=0;
    $query .= "and ($field = $cats[$j] ";
    while($j<$num_cats) {
    $query .= "or $field = $cats[$j] ";
    $j++;
    }
    $query .= ") ";
    }

    elseif($field=='cat2' && !empty($cat)) {
    $j=0;
    $query .= "and ($field = $cats[$j] ";
    while($j<$num_cats) {
    $query .= "or $field = $cats[$j] ";
    $j++;
    }
    $query .= ") ";
    }

    Thanks esm, your a superstar yet again

    Rob

  4. #4
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    looks about what I would have tried...

    just one small thing.

    change the two elseif's to if
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  5. #5
    Join Date
    Sep 2002
    Posts
    60

    Default

    Tried it with both the elseif and the if.

    Results...

    elseif:

    Still doesn't recoginse the secondary or third choice cats.

    if:

    doesn't recoginse any of the cats, i get no links for any search.

    I'm going to try and spend a couple of hours today working on the fix, just hope none of the people signing up notice it

    If you get any more ideas, let me know.

    Thanks again

    Rob

  6. #6
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    use the elseif and make the following change:

    Code:
    elseif($field=='cat1' && !empty($cat)) {
    $j=0;
    $query .= "or ($field = $cats[$j] ";
    while($j<$num_cats) {
    $query .= "or $field = $cats[$j] ";
    $j++;
    }
    $query .= ") ";
    }
    
    elseif($field=='cat2' && !empty($cat)) {
    $j=0;
    $query .= "or ($field = $cats[$j] ";
    while($j<$num_cats) {
    $query .= "or $field = $cats[$j] ";
    $j++;
    }
    $query .= ") ";
    }

    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  7. #7
    Join Date
    Sep 2002
    Posts
    60

    Default

    Your an even bigger superstar now

    Thank you my friend very much.

    Any idea how we get the number of links to work properly, as it doesn't look like its picking up the second and third category suggestions either?

  8. #8
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Here is my solution, open power_search.php line 114-122
    Code:
        if($field=='category_id' && !empty($cat)) {
          $j=0;
          $query .= "and ($field = $cats[$j] ";
          while($j<$num_cats) {
            $query .= "or $field = $cats[$j] or cat1 = $cats[$j] or cat2 = $cats[$j] ";
            $j++;
          }
          $query .= ") ";      
        }
    This code fix has been added in v.3.2

  9. #9
    Join Date
    Feb 2004
    Posts
    455

    Default

    When are you going to share Indexu 3.2! Are we going to have to pay for the bugs fix if our lisence has expire?

  10. #10
    Join Date
    Oct 2003
    Location
    R.T.U
    Posts
    580

    Default

    i know, come on dody? what type of management development is that? you talk and talk about version 3.2 but seems so far, and some of us will get their licenses expired after waiting almost a whole year...
    Polo

    --------------------------------------
    Christian Website

Similar Threads

  1. Replies: 3
    Last Post: 10-02-2002, 12:58 PM
  2. Sorting using Power Search
    By vakil in forum v3.2
    Replies: 1
    Last Post: 10-01-2002, 11:02 PM
  3. Search
    By joyorudis in forum v3.2
    Replies: 0
    Last Post: 09-18-2002, 07:50 AM
  4. Search Box on third party sites !
    By ideavirus in forum v3.2
    Replies: 0
    Last Post: 08-31-2002, 07:59 AM
  5. Search Log Improvements
    By Hart_House in forum v3.2
    Replies: 0
    Last Post: 08-30-2001, 11:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •