Jump to content
Sign in to follow this  
Guest fyrestrtr

Bug in Library Search

Recommended Posts

Guest fyrestrtr

There is a small bug in the search box in that it doesn't trim leading or trailing whitespace. Thus, if you search for a file that is it there, but you hit an extra space in the name, it won't find it.Try it out:Search for'PMDG747_advancedtutorial.zip ' (without the quotes) and you will get:Searching for: 'pmdg747_advancedtutorial.zip ' in AVSIM File Library and below.and no results.Then, delete the last space and search for'PMDG747_advancedtutorial.zip' (without quotes)And you'll get the hit.It should be trivial to fix :)

Share this post


Link to post
Share on other sites

That is not a bug. That's deliberate. All search engines, at least in forums that I have used, do exactly the same. If we were to "fix" that, you would not be able to do multiple word searches at all.

Share this post


Link to post
Share on other sites
Guest fyrestrtr

Sorry, but this bug has nothing to do with multiple word searching. Simply speaking:The engine takes leading or trailing whitespace as being significant in the search; which has no bearing on multiple words.Example:Ignore the quotes, as they are used to indicate the search key'hello there sam 'The system will search for literally, the string hello there sam, followed by the number of spaces; it should only search for the string 'hello there sam'.Easy way to see this fail is if you type a space after a filename that you know is in the library, the search will fail to bring it up as it takes leading or trailing whitespace to be significant.Take this file: 2005cals.zipIf you know the file name, you must type it in, but without any leading or trailing whitespace.Clearly:'2005cals.zip'' 2005cals.zip'' 2005cals.zip 'Are searches for the same file, but only the first one will trigger the correct search result.The reason this doesn't affect multiple words is because the system should only ignore the spaces before and after the last search key, so:' hello there sam 'Should be searched as:'hello there sam'Not literally .. three spaces hello there sam three spaces.Hope this helps :)

Share this post


Link to post
Share on other sites

Ooookay... simple solution. Don't add additional spaces in the search term before or after. Pretty simple.

Share this post


Link to post
Share on other sites
Guest fyrestrtr

Or, just have the search engine trim the key, which almost all do :)Most people don't notice the extra space, especially if you copy paste the file from a forum post; very easy to catch an extra space or two.In search.php:trim($_GET['SearchTerm']) will do it.There is an easy javascript fix for it too, but I personally don't like javascript 'fixes'.Just trying to help :)Edit:Seems the forum software doesn't like the left and right square brackets, and replaces them with < >.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...