View Full Version : Search.php question
What part of the code exactly checks to make sure that the word you are trying to search for is past the minimum char limit you have set?
Marco van Herwaarden
11-16-2005, 05:43 PM
I haven't check, but i guess none. The limit is probably already set at time of posting.
I am talking about searching for a string. You limit the search string so users can't search for very small words like AB and drag the server down. There is a check in search.php that checks that minimum char limit then tests the search string agansit it. What code does that?
I am talking about searching for a string. You limit the search string so users can't search for very small words like AB and drag the server down. There is a check in search.php that checks that minimum char limit then tests the search string agansit it. What code does that?
Anyone? Is there a better section to ask this in to get a response?
Marco van Herwaarden
11-22-2005, 03:57 AM
Like i already said, the limit is enforced at the time of posting, not at the time of searching.
What vB version are you using?
What search method have you set in ACP?
What are you trying to do?
VB 3.0
Your wrong. In search.php there is a section of code that tests the value the user is trying to search for agansit the minimum search limit.
I have it set at 4+. If you search for ABC it says: String too small. Search for ABCD and it works or ABC*.
What code does that check?
It has nothing to do with posting.
Marco van Herwaarden
11-22-2005, 09:57 AM
This is done by the function is_index_word() in ./includes/functions_databuild.php
Where in search calls that function?
What I am trying to do is allow certain user groups to ability to search for under the minimum number of characters. I tried working with that fucntion but it doesn't seem to work anyway I do it.
Marco van Herwaarden
11-22-2005, 09:33 PM
Words shorter then the minimum are never even stored in the word table. So you can search whatever you want, but those words will never be found anyway.
That is what i am trying to tell you from the beginning.
PS It gets called from functions_search.php if i remember correct.
Gotcha! That makes sense. I've gotten it to feed me back the STRING CANNOT BE FOUND instead of NOT ENOUGH CHARACTERS but couldn't figure out why. I didn't know it stores all the words into a table just for searching.
I apoligize!
Marco van Herwaarden
11-22-2005, 09:58 PM
That is why i said the limit was enforced at time of posting.
That is why i said the limit was enforced at time of posting.
You are correct I just thought we were on different pages. Again my apoligies.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.