Search function with CI |
[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) =)
[eluser]Colin Williams[/eluser]
Actually, it's just there to throw you off. Worked pretty well!
[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.
[eluser]Colin Williams[/eluser]
EE = ExpressionEngine. It is the CMS that powers the codeigniter.com Web site and forums
[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?
[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 |
Welcome Guest, Not a member yet? Register Sign In |