Re: search functionality for whole website

2006-07-20 Thread Langdon Stevenson

Bearing in mind that the aim here is to provide a site wide search ...

There are a lot of ways that you can use Lucene (and I am not an expert 
in it, so best to read up on Lucene yourself to get a really good 
understanding).  We used it to index pages just like a search engine 
does.  Therefore if your database data is browsable within the website 
then Lucene will index it and make it searchable.

However you could also add, modify, and delete Lucene entries when you 
update your database records and include a URL to the controller/view 
that will display that data.

There are lots of ways that you could solve the problem of site wide 
search (and this discussion has been giving me some ideas too for my 
current project).  So the best thing you could do I think is study up on 
Lucene and work out how best to integrate it to your project.

Regards,
Langdon


Ryan Petrain wrote:
> The only drawback to this is if your data that want to search is in the 
> database.
> Does Lucene index the database too?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: search functionality for whole website

2006-07-20 Thread DJ Spark

 yo teemow,

 thanks for the tip here, i'll check if that's what I need here :)

 see ya in koln :)

 spark!

On 7/20/06, teemow <[EMAIL PROTECTED]> wrote:
>
> hey spark,
>
> there is a lucene lib in the zend 'framework'. you just have to put it
> in your vendors folder. so if you like to implement an advanced search
> solution take a look at the advantages of an indexer over a database.
>
> http://lucene.apache.org/java/docs/features.html
>
> greez,
> timo
>
>
> >
>


-- 
[web] http://synapsisdi.com.br
[livesets] http://djspark.com.br

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: search functionality for whole website

2006-07-20 Thread Ryan Petrain
The only drawback to this is if your data that want to search is in the database.Does Lucene index the database too?On 7/20/06, Langdon Stevenson <
[EMAIL PROTECTED]> wrote:
I have to agree with timo here.  I was involved in the development of avery powerful search tool based on Lucene.  If you want really powerfulsite wide searching then this is the way to go.Regards,Langdon
teemow wrote:> hey spark,>> there is a lucene lib in the zend 'framework'. you just have to put it> in your vendors folder. so if you like to implement an advanced search> solution take a look at the advantages of an indexer over a database.
>> http://lucene.apache.org/java/docs/features.html>> greez,> timo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: search functionality for whole website

2006-07-20 Thread Langdon Stevenson

I have to agree with timo here.  I was involved in the development of a 
very powerful search tool based on Lucene.  If you want really powerful 
site wide searching then this is the way to go.

Regards,
Langdon


teemow wrote:
> hey spark,
> 
> there is a lucene lib in the zend 'framework'. you just have to put it
> in your vendors folder. so if you like to implement an advanced search
> solution take a look at the advantages of an indexer over a database.
> 
> http://lucene.apache.org/java/docs/features.html
> 
> greez,
> timo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: search functionality for whole website

2006-07-20 Thread teemow

hey spark,

there is a lucene lib in the zend 'framework'. you just have to put it
in your vendors folder. so if you like to implement an advanced search
solution take a look at the advantages of an indexer over a database.

http://lucene.apache.org/java/docs/features.html

greez,
timo


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: search functionality for whole website

2006-07-19 Thread DJ Spark

 thank you for the feedback, felix,
 so, for a start, i will just check if there's a exact match for
title/name fields.
if not found, try a more broad regex LIKE '%$conditions%' for title/name ,
if not found, search in other fields

$conditions = $this->params['url']['s'];
$results['exact']['filme'] = $this->Filme->findAll(array('title'=>$conditions));

if not found

$results['fuzzy']['filme'] = $this->Filme->findAll("title LIKE
'%".$conditions."%'");

if not found

$results['full']['filme'] = $this->Filme->findAll("slug LIKE
'%".$conditions."%' OR titulo_original LIKE '%".$conditions."%' OR
titulo_ingles LIKE '%".$conditions."%' OR sinopse LIKE
'%".$conditions."%' OR description LIKE '%".$conditions."%'");

 and use that array on the view

 looks simple and effective, but i'll post when i can make something better

 thank  you
 spark

On 7/19/06, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
>
>  Hi spark,
>
>  unfortunately the code I've written was for searching local files and
> doesn't make usage of several advantages you've
>  got when working with databases, so it would not be worth for you trying to
> apply it to your own solution. Other then that
>  I've written some regex that will parse the queries, so "connected
> keywords" will be recognized and stupid user mistakes
>  like doubling keywords will be ignored. But if you are good with regex
> yourself that shouldn't take you that long.
>
>  Regarding ranking, there is almost no limit on the complexity of the
> algorithm you may use to determine one items
>  popularity. I think user feedback should be weighted pretty high, but only
> if the input can be trusted. And to determine
>  trusted feedback from spam & manipulation can be pretty tricky. So this
> isn't something I would completely rely on, when
>  implementing search in a site where advantages can be taken from having
> certain items high up in the serps (search result
>  pages).
>
>  A better solution is to put efforts into understanding the relationships of
> the items you are trying to compare. Now, when searching
>  your own database, you are in the lucky situation that you can track things
> like item popularity, creation / updated time stamps and
>  tons of other useful information, just like Amazon does with "Other people
> who liked this product also bought ..." that you wouldn't be
>  able to track, when searching through foreign databases (or web sites). Of
> course, this is sort of suffering from similar problems
>  like the idea of taking user feedback.
>
>  So again, I think it would be really nice to have a generic search solution
> for cakephp that's based on a central Search Model that
>  get's it's informations from special Crawler (Components?) written by the
> community. This would be quite challenging, but as a result,
>  we could have a common data interface for the applications we write with,
> that we could make available as a web service. I'm sure
>  there are tons of sweet things we could do with that.
>
>  Alright, but before I start to sound like an employee of this big company
> that tries to index the entire world, I'll stop here and leave it
>  to you to figure out what will be the best solution for the site you are
> creating ; ).
>
>
>  Best Regards,
>  Felix Geisendörfer
>
> --
>  http://www.thinkingphp.org
>  http://www.fg-webdesign.de
>
>  DJ Spark schrieb:
>  quite elegant solution, gwoo ! thanx!
>
>  i'm also working on a tiny search for a project in cakephp, Felix.
> Anyone have some references on search enhancements? ( like that in
> youtube, for example, where a string is sent and it says it comes from
> a search result, a ranks it better on the next search for the same
> term).
>  Any article related would be a good reading for me at this point ;)
>
>  spark
>
>
>
> On 7/19/06, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
>
>
>  Well you could refactor the Search functionality into an own model, which
> would make
>  sense to me. But you don't necessarily have to do that. You can put this in
> any controller
>  to say that no Model is being used:
>
>  var $uses = array();
>
>  But really, if you plan to implement a quality search into a high usage web
> site, you should
>  seriously consider maintaining an own search index as well as to do some
> regex on the
>  queries (so users can use "two words" and such). Once you get into this
> topic you'll find out,
>  that doing a good job on search (even for your own db), is not all that
> easy. I mean you can
>  literally spend 50 hours (and more ...) to write the code required for an
> intelligent search tool.
>  I've worked on a file search tool for my personal use in CakePHP, and I was
> really surprised
>  about the complexity that comes with it. If I find some time this sommer I
> might try to create a
>  Generic Search Model for CakePHP, that will work together with different
> types of crawlers you
>  can create by yourself (DB Tables, RSS feeds, Html, XML, Image Meta dat

Re: search functionality for whole website

2006-07-19 Thread Felix Geisendörfer




Hi spark,

unfortunately the code I've written was for searching local files and
doesn't make usage of several advantages you've
got when working with databases, so it would not be worth for you
trying to apply it to your own solution. Other then that
I've written some regex that will parse the queries, so "connected
keywords" will be recognized and stupid user mistakes
like doubling keywords will be ignored. But if you are good with regex
yourself that shouldn't take you that long.

Regarding ranking, there is almost no limit on the complexity of the
algorithm you may use to determine one items
popularity. I think user feedback should be weighted pretty high, but
only if the input can be trusted. And to determine
trusted feedback from spam & manipulation can be pretty tricky. So
this isn't something I would completely rely on, when
implementing search in a site where advantages can be taken from having
certain items high up in the serps (search result
pages).

A better solution is to put efforts into understanding the
relationships of the items you are trying to compare. Now, when
searching
your own database, you are in the lucky situation that you can track
things like item popularity, creation / updated time stamps and
tons of other useful information, just like Amazon does with "Other
people who liked this product also bought ..." that you wouldn't be 
able to track, when searching through foreign databases (or web sites).
Of course, this is sort of suffering from similar problems
like the idea of taking user feedback.

So again, I think it would be really nice to have a generic search
solution for cakephp that's based on a central Search Model that
get's it's informations from special Crawler (Components?) written by
the community. This would be quite challenging, but as a result, 
we could have a common data interface for the applications we write
with, that we could make available as a web service. I'm sure 
there are tons of sweet things we could do with that.

Alright, but before I start to sound like an employee of this big
company that tries to index the entire world, I'll stop here and leave
it
to you to figure out what will be the best solution for the site you
are creating ; ).

Best Regards,
Felix Geisendörfer
--
http://www.thinkingphp.org
http://www.fg-webdesign.de



DJ Spark schrieb:

   quite elegant solution, gwoo ! thanx!

 i'm also working on a tiny search for a project in cakephp, Felix.
Anyone have some references on search enhancements? ( like that in
youtube, for example, where a string is sent and it says it comes from
a search result, a ranks it better on the next search for the same
term).
 Any article related would be a good reading for me at this point ;)

 spark



On 7/19/06, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
  
  
 Well you could refactor the Search functionality into an own model, which
would make
 sense to me. But you don't necessarily have to do that. You can put this in
any controller
 to say that no Model is being used:

 var $uses = array();

 But really, if you plan to implement a quality search into a high usage web
site, you should
 seriously consider maintaining an own search index as well as to do some
regex on the
 queries (so users can use "two words" and such). Once you get into this
topic you'll find out,
 that doing a good job on search (even for your own db), is not all that
easy. I mean you can
 literally spend 50 hours (and more ...) to write the code required for an
intelligent search tool.
 I've worked on a file search tool for my personal use in CakePHP, and I was
really surprised
 about the complexity that comes with it. If I find some time this sommer I
might try to create a
 Generic Search Model for CakePHP, that will work together with different
types of crawlers you
 can create by yourself (DB Tables, RSS feeds, Html, XML, Image Meta data,
...). I think it's quite
 an interesting topic and if anybody else would be interested in it it might
well be worth a little
 CakeForge project.

 Best Regards,
 Felix Geisendörfer

--
 http://www.thinkingphp.org
 http://www.fg-webdesign.de

 carlosrg schrieb:
 But, we need a model for this Controller, it's ok? What should be the
model?






 >



  
  

  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---





Re: search functionality for whole website

2006-07-19 Thread DJ Spark

 quite elegant solution, gwoo ! thanx!

 i'm also working on a tiny search for a project in cakephp, Felix.
Anyone have some references on search enhancements? ( like that in
youtube, for example, where a string is sent and it says it comes from
a search result, a ranks it better on the next search for the same
term).
 Any article related would be a good reading for me at this point ;)

 spark



On 7/19/06, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
>
>  Well you could refactor the Search functionality into an own model, which
> would make
>  sense to me. But you don't necessarily have to do that. You can put this in
> any controller
>  to say that no Model is being used:
>
>  var $uses = array();
>
>  But really, if you plan to implement a quality search into a high usage web
> site, you should
>  seriously consider maintaining an own search index as well as to do some
> regex on the
>  queries (so users can use "two words" and such). Once you get into this
> topic you'll find out,
>  that doing a good job on search (even for your own db), is not all that
> easy. I mean you can
>  literally spend 50 hours (and more ...) to write the code required for an
> intelligent search tool.
>  I've worked on a file search tool for my personal use in CakePHP, and I was
> really surprised
>  about the complexity that comes with it. If I find some time this sommer I
> might try to create a
>  Generic Search Model for CakePHP, that will work together with different
> types of crawlers you
>  can create by yourself (DB Tables, RSS feeds, Html, XML, Image Meta data,
> ...). I think it's quite
>  an interesting topic and if anybody else would be interested in it it might
> well be worth a little
>  CakeForge project.
>
>  Best Regards,
>  Felix Geisendörfer
>
> --
>  http://www.thinkingphp.org
>  http://www.fg-webdesign.de
>
>  carlosrg schrieb:
>  But, we need a model for this Controller, it's ok? What should be the
> model?
>
>
>
>
>
>
>  >
>
>


-- 
[web] http://synapsisdi.com.br
[livesets] http://djspark.com.br

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: search functionality for whole website

2006-07-19 Thread Felix Geisendörfer




Well you could refactor the Search functionality into an own model,
which would make
sense to me. But you don't necessarily have to do that. You can put
this in any controller
to say that no Model is being used:

var $uses = array();

But really, if you plan to implement a quality search into a high usage
web site, you should
seriously consider maintaining an own search index as well as to do
some regex on the
queries (so users can use "two words" and such). Once you get into this
topic you'll find out,
that doing a good job on search (even for your own db), is not all that
easy. I mean you can
literally spend 50 hours (and more ...) to write the code required for
an intelligent search tool.
I've worked on a file search tool for my personal use in CakePHP, and I
was really surprised
about the complexity that comes with it. If I find some time this
sommer I might try to create a
Generic Search Model for CakePHP, that will work together with
different types of crawlers you
can create by yourself (DB Tables, RSS feeds, Html, XML, Image Meta
data, ...). I think it's quite
an interesting topic and if anybody else would be interested in it it
might well be worth a little
CakeForge project.

Best Regards,
Felix Geisendörfer
--
http://www.thinkingphp.org
http://www.fg-webdesign.de



carlosrg schrieb:

  But, we need a model for this Controller, it's ok? What should be the
model?




  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---





Re: search functionality for whole website

2006-07-19 Thread carlosrg

But, we need a model for this Controller, it's ok? What should be the
model?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: search functionality for whole website

2006-07-18 Thread bingo

Thanks

Got working with the above approach.

Regards,


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: search functionality for whole website

2006-07-18 Thread gwoo

class SearchController extends AppController {

var $name = 'Search';
var $uses = array('Model1','Model2','Model3');

function results() {

$results = array();
$conditions = $this->params['url']['searchfieldname'];
$results[] = $this->Model1->findAll($conditions);
$results[] = $this->Model2->findAll($conditions);
$results[] = $this->Model3->findAll($conditions);

$this->set('results', $results);
 }

}

hows that look?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---