Yii Framework Forum: Search Engine For Electronic Commerce With Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Search Engine For Electronic Commerce With Yii Rate Topic: -----

#1 User is offline   Jinsa86 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 02-December 13

Posted 18 December 2013 - 10:52 AM

Hi there!

First post on your forum. I would like to thank the community as I spent hours reading this forum and each time I found a solution to my problems :)

This time I need your help concerning a decision I should take concerning search engine. In past projects I used Lucene extension and I managed to put it in production. Results are good but it's very simple and my website has a low trafic.

Now I've built a team and we are working on a new project of electronic commerce built on Yii (Yes we can!). One big part will be to handle clients high requests on our products and we need a strong search engine that could handle massive clients query.

After a google search I found the Apache SOLR project. It seems to be fit to high request volumes but when I check the extension done in Yii I feel like it doesn't really fetch with Active Records. In fact it seems that if I do a $object->save() it will save in my SQL database but I also need to write my data in SOLR so it's like keeping two databases updated at a time.

My questions are:

- is SOLR a solution for my query? if not is there something to handle/create a strong search module in Yii?
- do I really need to have two database (I consider a lucene index as a database) or is there a way to abstract this part and use AR directly?
- do you know what kind of search tools major compagny like Amazon are using to have such performance?

Thanks for your help! :)
0

#2 User is offline   Bùi Thanh Liêm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 26-April 12
  • Location:Viet Nam

Posted 18 December 2013 - 08:47 PM

View PostJinsa86, on 18 December 2013 - 10:52 AM, said:

Hi there!

First post on your forum. I would like to thank the community as I spent hours reading this forum and each time I found a solution to my problems :)

This time I need your help concerning a decision I should take concerning search engine. In past projects I used Lucene extension and I managed to put it in production. Results are good but it's very simple and my website has a low trafic.

Now I've built a team and we are working on a new project of electronic commerce built on Yii (Yes we can!). One big part will be to handle clients high requests on our products and we need a strong search engine that could handle massive clients query.

After a google search I found the Apache SOLR project. It seems to be fit to high request volumes but when I check the extension done in Yii I feel like it doesn't really fetch with Active Records. In fact it seems that if I do a $object->save() it will save in my SQL database but I also need to write my data in SOLR so it's like keeping two databases updated at a time.

My questions are:

- is SOLR a solution for my query? if not is there something to handle/create a strong search module in Yii?
- do I really need to have two database (I consider a lucene index as a database) or is there a way to abstract this part and use AR directly?
- do you know what kind of search tools major compagny like Amazon are using to have such performance?

Thanks for your help! :)


hi, I'm using Yii with solr, it's good search engine. Solr index your data in solr location (in ram), so when your data change, you have to reindex changed data to solr, but it's very fast -> it ok! (sory because my english :D)
Bùi Thanh Liêm
ĐTDĐ: (+84)973499330
Email: liem04@gmail.com
Skype: liempro88
Y!M: liempro88
website: http://bibomart.com.vn
0

#3 User is offline   Jinsa86 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 02-December 13

Posted 19 December 2013 - 05:25 AM

View PostBùi Thanh Liêm, on 18 December 2013 - 08:47 PM, said:

hi, I'm using Yii with solr, it's good search engine. Solr index your data in solr location (in ram), so when your data change, you have to reindex changed data to solr, but it's very fast -> it ok! (sory because my english :D)

Hi!

Thanks for your reply :). Ok and how did you manage to update data? Each time you make a db update you also update your SOLR index or you have a "global update" function that exports all data to your SOLR index?

I think that I will write new function that saves my data both in SQL and in SOLR but maybe someone already did it...
0

#4 User is offline   twisted1919 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 654
  • Joined: 23-October 10
  • Location:Romania

Posted 19 December 2013 - 09:10 AM

Hi, have you considered elasticsearch?
You will install the daemon on your server and it will offer you an API interface to update your search indexes.
There are clients(php classes) like ElasticaSearch that you can use in php to communicate with your elasticsearch daemon, that is to index, search, delete, etc.

Using with Yii is very simple, you can hook into the afterSave() event of CActiveRecord to send your record to be indexed in elasticsearch, same you can hook into afterDelete() to remove an indexed record from elasticsearch thus removing the need to have a cron job running to index your records.

I have used it in a huge search driven application with extraordinary results :)
Give it a try, you will love it.
0

#5 User is offline   Bùi Thanh Liêm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 26-April 12
  • Location:Viet Nam

Posted 19 December 2013 - 10:12 AM

View PostJinsa86, on 19 December 2013 - 05:25 AM, said:

Hi!

Thanks for your reply :). Ok and how did you manage to update data? Each time you make a db update you also update your SOLR index or you have a "global update" function that exports all data to your SOLR index?

I think that I will write new function that saves my data both in SQL and in SOLR but maybe someone already did it...

Hi, you can use afterSave(), afterDelete() event in Yii to update your data to Solr. To connect to Solr, I use solr extension(http://www.yiiframew.../extension/solr). If you want to make sure, you can run cronjob to update all your data to solr everyday :D
Bùi Thanh Liêm
ĐTDĐ: (+84)973499330
Email: liem04@gmail.com
Skype: liempro88
Y!M: liempro88
website: http://bibomart.com.vn
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users