I have managed finally to get Solr working, with the help of all you guys, so THANK YOU! And I have to say, I now understand why you recommended it, it's really powerful.
Şimdi, konuya ...
I have indexed all "Searchable" information into Solr
, and my plan is to query Solr, and then get the ID:s
of the query-results (of all records that is, each has an ID field value), which I then use to query MySQL
and fetch the rest of the information.
So, first query Solr, next solr sends back id:s for all ads which match the query, then I use the ID:s to query MySQL for the rest of the info.
My Q is, When doing the part with MySql, should I save all the received ID:s into an array
, and then query mysql
to find all records with those ID:s?
Should I do something like this? (might contain some code errors):
for ($i=0; $i<$id_from_solr.length; $i++){
mysql_query("SELECT * FROM table_name WHERE ad_id=$id_from_solr[$i]");
}
O her tekrar döngüler "yeni sorgu" yapar, çünkü yukarıda, not iyi bir çözüm gibi görünüyor!
Bunu nasıl yapardın?
Follow-up Question: Would adding a sort function into the MySQL query slow things down compared to WITHOUT using the sort function? for example:
ORDER BY insert_date ASC
And last Q: Is there anyway to cache MySQL results so when sorting, I don't have to make a new query?
Teşekkürler alot!
Eğer daha fazla girdi ihtiyacınız varsa, bana bildirin ve ben bu Q güncelleme olacak!