Welcome Guest, Not a member yet? Register   Sign In
How to perform advanced searches on db
#1

[eluser]Unknown[/eluser]
Hello everybody!

I'm currently developing an application using CI but I'm stuck writing a decent internal searche engine.
My main problem is that I can't use mix urls with CI, and so I have no idea of what would be the right path to follow.
My goal would be to perform fulltext searches on the db via a simple form with one input field, or more complex searches via a form with multiple params.

Can someone please help me?

I searched the entire forum but it seems anyone talks about this problem.
#2

[eluser]zimco[/eluser]
There's actually been alot of discussion about writing search engines and implementing in CI, but it can be hard to find the threads(i searched the forums using keywords "search engines" and lucene). Anyhow here's one i found you might find useful http://ellislab.com/forums/viewthread/92164/

From reading various CI threads about search engines it seems alot of developers just like to drop a third-party search engine in their apps and let it do all the heavy lifting like:
lucene - http://framework.zend.com/manual/en/zend...ucene.html
sphinx - http://sphinxsearch.com/

However, i found that's not as easy as it sounds if you are not familiar with the third-party engines and the learning curve is pretty steep; it scared me off from them Wink

If you want something really simple like you described: one form, with one input field, that does a fulltext search via something like mysql's fulltext index on a column in a myisam database, that's really not too hard to implement in CI.

It really depends on what you need your search engine to be able to do.
#3

[eluser]Unknown[/eluser]
Well i read the thread you mentioned but my problem is not on the sql side.
My problem is how to build the query string that feeds the sql query.

I analized how codeigniter.com and expressionengine.com portals do their internal searches.
I think the solution would be to route the searches to a controller via post and then reload a view with the query string in the url.

Something like this:
Search for "foo"->route to controller "search"->load the view http://localhost/results/foo

Then you can build more complex query strings.

Don't think to implement third party apps anyway.




Theme © iAndrew 2016 - Forum software by © MyBB