Welcome Guest, Not a member yet? Register   Sign In
Search function with CI
#1

[eluser]hykoh[/eluser]
Hello,

how did you make the search function in this forum with CI ?

http://ellislab.com/forums/search_result...d8eba10bd/

is "59e258a519db8daa508563fd8eba10bd" a special key in the DB that saves the results ? i dont know how i could code it in my project...

please help me (how to save results temporary anywhere / pagination must be possible) =)
#2

[eluser]Colin Williams[/eluser]
Actually, it's just there to throw you off. Worked pretty well!
#3

[eluser]Popcorn[/eluser]
Colin, that didn't make sense.
#4

[eluser]hykoh[/eluser]
o_O ?
#5

[eluser]hykoh[/eluser]
do you know what i am talking about ?
#6

[eluser]kevinprince[/eluser]
Hykoh the MD5 hash is purely for performance

User Searchs > EE searchs and caches the results under an MD5 hash of the search term.

How to do it?

As part of the search, take your returned results assuming this is an array, seralize them and store in the DB with the search term as an MD5 hash in an indexed column.

Then when you search, check the MD5 hash to see if it exists, if it does return the seralized results instead of crawling the DB again.

You need to also add a lifespan so results dont stay cached forever.
#7

[eluser]hykoh[/eluser]
What do you mean with EE ?
#8

[eluser]Colin Williams[/eluser]
EE = ExpressionEngine. It is the CMS that powers the codeigniter.com Web site and forums
#9

[eluser]bitist[/eluser]
[quote author="nextgengames" date="1231120465"]Hykoh the MD5 hash is purely for performance
Then when you search, check the MD5 hash to see if it exists, if it does return the seralized results instead of crawling the DB again.
[/quote]

What is storing in the database? The search results or just the search term?
Eg. if I search "codeigniter", then the word codeigniter will be stored?
#10

[eluser]nikefido[/eluser]
[quote author="devpedia" date="1231204447"][quote author="nextgengames" date="1231120465"]Hykoh the MD5 hash is purely for performance
Then when you search, check the MD5 hash to see if it exists, if it does return the seralized results instead of crawling the DB again.
[/quote]

What is storing in the database? The search results or just the search term?
Eg. if I search "codeigniter", then the word codeigniter will be stored?[/quote]

Without really knowing myself, I would guess it saves the serialized array of ID's of posts generated by the search term




Theme © iAndrew 2016 - Forum software by © MyBB