Welcome Guest, Not a member yet? Register   Sign In
Creating a search tool for a web app'
#1

[eluser]Wayne Smallman[/eluser]
Hi guys!

I've had a look around in the forums, but nothing's jumped out at me.

I'm at a stage in a client project where I need to add a search tool to a web app'. So I'm trying to find out if either there's a built in library to do this, or someone's already done something similar.

Any suggestions?
#2

[eluser]Clooner[/eluser]
[quote author="Wayne Smallman" date="1275933152"]Hi guys!

I've had a look around in the forums, but nothing's jumped out at me.

I'm at a stage in a client project where I need to add a search tool to a web app'. So I'm trying to find out if either there's a built in library to do this, or someone's already done something similar.

Any suggestions?[/quote]
Mostly searches are done using fulltext search or like in sql.

ci has build in support for the like command in AR.
Code:
$this->db->like('title',$keyword);
$this->db->or_like('description', $keyword);
#3

[eluser]n0xie[/eluser]
Google sitesearch?
#4

[eluser]Wayne Smallman[/eluser]
[quote author="clooner" date="1275933450"][quote author="Wayne Smallman" date="1275933152"]Hi guys!

I've had a look around in the forums, but nothing's jumped out at me.

I'm at a stage in a client project where I need to add a search tool to a web app'. So I'm trying to find out if either there's a built in library to do this, or someone's already done something similar.

Any suggestions?[/quote]
Mostly searches are done using fulltext search or like in sql.

ci has build in support for the like command in AR.
Code:
$this->db->like('title',$keyword);
$this->db->or_like('description', $keyword);
[/quote]Hi and thanks!

Is there a help page for these options?

Also, what's AR?
#5

[eluser]Wayne Smallman[/eluser]
[quote author="n0xie" date="1275933461"]Google sitesearch?[/quote]Hi and thanks!

I'd prefer not to be using anything external for this application. Plus it just doesn't look professional.
#6

[eluser]mddd[/eluser]
@Wayne:

AR means 'active record'. For help on Like() check the Mysql manual. CodeIgniter's database functions are just a representation of the functions in Mysql (or any other database you are using). If you want to know all the details you should look at the manual of your database.

For searching full text, Match() can be better than Like() because it searches in a more natural way. For instance, if the word you search for is in the text more often, the result will automatically be shown at the top of the result list.
#7

[eluser]Wayne Smallman[/eluser]
[quote author="mddd" date="1275935170"]@Wayne:

AR means 'active record'. For help on Like() check the Mysql manual. CodeIgniter's database functions are just a representation of the functions in Mysql (or any other database you are using). If you want to know all the details you should look at the manual of your database.

For searching full text, Match() can be better than Like() because it searches in a more natural way. For instance, if the word you search for is in the text more often, the result will automatically be shown at the top of the result list.[/quote]Hi! Yeah, I managed to find it.

This is interesting. I didn't know about this kind of thing.

Excellent. Thanks guys!
#8

[eluser]mattthehoople[/eluser]
I've integrated Zend Lucene search a couple of times with great results, just re-index each day (or every half hour if like) on a cron job. I've a bit of a messy library you're more than welcome to use if you like.




Theme © iAndrew 2016 - Forum software by © MyBB