CodeIgniter Forums
MeNeedz Search - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: MeNeedz Search (/showthread.php?tid=15288)

Pages: 1 2 3 4


MeNeedz Search - El Forum - 01-30-2009

[eluser]davidbehler[/eluser]
Hi, it's me again!
And this time I bring you: Search!

Don't know what I'm talking about? Let me try to explain:
Have you ever had to build a search function for a page? Change your query depending on the fields submitted by the user, check if there are results, get results, etc. Wouldn't it be nice if someone would do that for you? And that's where my library comes into play.

All you have to do is, create a table in your database, set up the config for your search in the config file and call one method, that's it! Every time you perform a search all the results, etc. are saved in the database. Now let's say your results are displayed over multiple pages, normally you would have to perform the search for each page and change the limit depending on the page and the number of entries per page. If you use my library you have to do nothing but pass the id of the search, the offset and the number of entries per page. My library gets the list of results of the search from the search table I use for "caching" the searches without doing the whole search query again.

Now you say: What happens if the result is not up to date anymore? Several topics that fit the criteria of the search where started after the search was performed. For this case I got a config variable that indicates the max age of a search. If the search is older than the max age, then the search is performed again and the row in the datase is updated...all without you doing anything but perform a search/scroll the search results.

Interested?

Just grab it from here: --&gt; click me <--
View the user guide here (also included in the download: --&gt; click me <--

Greets,
waldmeister


MeNeedz Search - El Forum - 01-30-2009

[eluser]ray73864[/eluser]
will this work for 'fulltext' searches using 'MATCH' and 'AGAINST'? in Boolean mode and natural mode?


MeNeedz Search - El Forum - 01-30-2009

[eluser]Colin Williams[/eluser]
What's with all the "cloud" business in the user guide?


MeNeedz Search - El Forum - 01-31-2009

[eluser]davidbehler[/eluser]
Forget about the "cloud" stuff in the guide.
I copied another user guide of mine and somehow missed some references to another library.

I have just updated the user guide and the library.
Fulltext search is now supported using the "MATCH (col_name) AGAINST (value MODE)" syntax.
Just set "MATCH" as the operator and set mode to "IN BOOLEAN MODE" or "WITH QUERY EXPANSION" or leave it blank for natural fulltext search.


MeNeedz Search - El Forum - 02-01-2009

[eluser]trice22[/eluser]
OT: THANKS for all the stuff you're contributing here. Interesting ideas, nice code and always beautifully documented. People like you are making this community what it is. Cheers!

Concerning this search script: I'll give this a try as soon as I get around to. Looks neat.
—trice


MeNeedz Search - El Forum - 02-01-2009

[eluser]davidbehler[/eluser]
Glad you like my stuff Smile
Most of the time I have to create some new libraries for projects of mine and think to myself "Maybe someone else might need this too". So I take my libs, try to generalise them (make them even more configurable so you can adjust them for your needs) and post them here!

I'm looking forward to some feedback on this library!


MeNeedz Search - El Forum - 02-04-2009

[eluser]Skuja[/eluser]
Hi waldmeister, thanks for your contribution. Currently i am trying to implement your library in one project and i have question for you:
I would also like scroll function to return search phrase in its result array. Should i make an extra query for that in the scroll, or is there any better way to achieve this?


MeNeedz Search - El Forum - 02-04-2009

[eluser]davidbehler[/eluser]
Well, I'm not exactly sure what you want to do Wink
I save to the database an array that contains the name of the column in the database, the name of the post field, the value of the post field and the operator that is used. I can add that array to the array that's returned by the scroll and perform methods if that would help you.


MeNeedz Search - El Forum - 02-04-2009

[eluser]Skuja[/eluser]
oh, thank you, i got it..

i added one more element 'post_value' to return array.


MeNeedz Search - El Forum - 02-04-2009

[eluser]davidbehler[/eluser]
Well, I have updated the library any way and added an extra array to the output that contains the where parameters used to perform the search.