1. New arrivals >>> "Awesome" JA Social Preview! - "Awesome" JAT3 Videos 06 videos!

+ Reply to Thread
 
Results 1 to 2 of 2
  1. #1
    Licensed Member
    JA Job Board [Standard] [Core Component & Modules]

    Join Date
    Dec 2009
    Posts
    8
    Points
    92.20
    Downloads
    0
    Uploads
    0
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Please login to vote

    Replacing search algorithm?

    Hello,

    I've been customising my install of JA Jobs for some time now, and I've managed to get the majority of the functionality I need, but there's something else I need to change, but I don't have access to the code.

    When an employer searches resumes, there is a box at the top for filtering results. This box is no use to me as it is, I need to replace the SQL query which is executed when something is entered into that box.

    As far as I can tell, this is handled by a function called geItemView_List() in the file models/jaresumes.php (Based on analysis of the unencoded parts of the view and controller.)

    As this file is IonCube encoded, I can not edit it. I need it to search my custom fields

    Simply adding the fields to the filter list is not acceptible, I need it to search 10 fields, and this puts too much junk on the screen, causing the width to go beyond any reasonable resolution in the process. I just want one search box, and a couple of filter drop-down boxes.

    Normally, I would just replace the code myself, but as this is not possible, can you do this for me? Could you modify the model file for jaresumes with my search query, re-encode the file, and send me the replacement?

    Code:
    $query = "SELECT * FROM #__ja_resumes WHERE CONCAT(`title`, ' - ', `education`, ' - ', `description`, ' - ', `summary`, ' - ', `current_employer`, ' - ', `cur5rent_job_title`, ' - ', `resume_language1`, ' - ', `resume_job_experienc`, ' - ', `resume_cat_pri`, ' - ', `resume_search cv`) LIKE '%" . $search_terms . "%'" ;
    Where $search_terms is the (sanitised) input from the search field.

    The query above has the names of my custom fields ( Yes, I mis-spelled some of the field names, and some were cut short as they were added to the db, but the names in the query there are exactly as spelled in my db, so it will work :P ).

    Code explanation:
    This query treats my 10 search fields as one big field, and then looks for occurrences of the search term anywhere inside the row. This means, for example, if someone searches the term "manage", it will return results with things like "manager" or "marketing manager". The % string in the comparison part of the query is a MySQL wildcard, much like *, concat merges the fields into one (not permanently, the database structure remains the same, it just returns the results inside the concat statement as one column), the " - " bits between the fields separates the data, so for example if we had a person's name in 2 fields, and their name was something like "Herman Agewell", this would be treated as "herman - agewell" and not "hermanagewell" (Which matches the search term "Manage") so it prevents false positives from the concatination process, and using "LIKE" instead of "=" uses MySQL's most basic built-in fuzzy logic method, so the search becomes case insensitive.

    I realise that this is potentially a very bloated query, but my current jobs site doesn't get huge amounts of traffic, so the benefit of the enhanced search outweighs the drawbacks in my case.

    Can you do this for me?

  2. #2
    JoomlArt Support Member JA Developer's Avatar
    Join Date
    Nov 2008
    Location
    Hanoi City
    Age
    25
    Posts
    6,119
    Points
    10,199.23
    Downloads
    493
    Uploads
    0
    Thanks
    206
    Thanked 1,544 Times in 1,333 Posts
    Please login to vote
    Hello holyroodcomms,

    JA Job Board version 1.4.0 is not encoded anymore. You can do any customization to fit your needs.
    Please click "thank you" button when get right answer from others.
    If your problem has been solved find the best answer and click (Mark Best Answer)

  3. The Following User Says Thank You to JA Developer For This Useful Post:

    holyroodcomms (01-27-2010)

+ Reply to Thread

Bookmarks

Posting Permissions

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