https://www.icyphoenix.com/viewtopic.php?f=35&t=8879
-----------------------------------
jefazo666
Wed 09 Jan, 2013 08:35

QuickSearch - How Does It Works?
-----------------------------------
Hi all, I have made a full search, but no results returned to this keyword. 

I am speaking about the automatic quick search that we can see when we create a new topic, and we write the subject, or title. There is a line (seems Ajax), down this text input that tells the user that there are some themes with the same keywords on their titles. 

I do not understand how this works. I have three topics, with this three titles:

word1
word2
word1 word2

when I try to create a fourth topic:
if I enter only word1, only two results are returned. This is ok.
if I enter only word2, again, two results are returned. This is also ok.
if I enter word1 word2, again 2 results are returned, I do not understand. 
if I enter word3, nothing is returned, this is ok.
if I enter word3 word1, nothing is returned, I am beginning to understand.

So, does it searches only for the first word? It is possible to search for all words? What if the users begins it topic with "how" word, or hello? does this checks for small words like A, the, of, with ... ?

Thanks a lot for the answers!


-----------------------------------
mort
Wed 09 Jan, 2013 12:01

Re: QuickSearch - How Does It Works?
-----------------------------------
From what I've read into the script, IP strips anything less than three characters "if searchword < 3 - scrap it" etc.  :mrgreen:

[b]Edit:[/b]

As a matter of fact, it's this part of the script.

[code linenumbers=false]		// 'words' that consist of <3 or >20 characters are removed.
		$entry = preg_replace('/[ ]([\S]{1,2}|[\S]{21,})[ ]/',' ', $entry);[/code]

And I ain't no preg_expert!  :mricy: But something is telling me that <= or >= has gone astray, and nothing is equal to 3 or 20

[code linenumbers=false]Maybe it needs a if($entry <= 3){echo 'Dude! you need more than three characters';};[/code]

Dunno,

But if anything else - It'll feed the spiders.   :lol:


