Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

How to set minimum character for SEARCH?


6 replies to this topic

#1 basketmen

  • Community Member
  • 26 posts
  • Real Name:basketmen

Posted 09 July 2009, 13:11

my site get very high load because i use "Default search operators" to OR, instead search operator AND, because i need more result for any queries

so maybe it is better if i can set minimum character for SEARCH for 3 or other number, is there setting or how to do that





please help guys, to reduce my server load (I use dedicated) and set minimum character for SEARCH
Deadline always

#2 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 09 July 2009, 13:21

you will need to add an extra test to advanced_search_result.php to set a min lenght for keywords

but what if they searchby date with no keywords ?

Have u turned off category counts, big reductions in queries there.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#3 basketmen

  • Community Member
  • 26 posts
  • Real Name:basketmen

Posted 09 July 2009, 20:53

yes i think the file need to edit is advanced_search_result.php

can someone write the code?

i think this is very important because all osc user use search, and this can reduce our server load
Deadline always

#4 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 09 July 2009, 21:25

This forum is to provide help, its not a free coding service.

If your not prepared to make any real effort to solve this rare need yourself, why do you think any-one else will be motivated to.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#5 basketmen

  • Community Member
  • 26 posts
  • Real Name:basketmen

Posted 10 July 2009, 01:49

no, this is not rare problem, it is for all osc user

just search 1 character for example like "A" its make more high load server, it is better if the search character below 4 character is not to search too


this is just a good contribution idea, and for anyone can make it
Deadline always

#6 bktrain

  • Community Member
  • 2,090 posts
  • Real Name:Brian
  • Gender:Male
  • Location:On the brink of insanity

Posted 10 July 2009, 02:46

Did you search the contributions to see if that has been done or do you expect others to do that for you as well?
Remember to backup database, files and pictures.

I reject your reality and substitute my own.
My mind not only wanders, it sometimes leaves completely.
The problem with the gene pool is that there is no lifeguard.
Everyone’s entitled to my opinion.


Links
Security
SSL Help
Basics for design
Basics for design V2.3+
How Do I ...?

#7 basketmen

  • Community Member
  • 26 posts
  • Real Name:basketmen

Posted 11 July 2009, 08:13

yes, i had search in addon section http://addon.oscommerce.com and tips and tricks forum, but there is no addon for this yet


the file name to search is advanced_search_result.php

oscommerce is very free famous script, but..

ironically this file is searching all words that typed by user, even just a single word like "A" or "An"
it is searching in mysql, so its make very very high load for the server, imagine its need to search for all words that contain "A", how if you have 100.000 products/items in your site



i am using vbulletin too, vbulletin is paid script, it is more professional then oscommerce, in vbulletin just searching words for more then 3 character, so it is highly better if oscommerce like that too
Deadline always