I’m building a web application with php and mysql. Web application will have 3-4 big tables (milions of records per table) where it will extremely important that it must be possible perform a full text search on it for search a term in text field. I design this web application with mysql because it need full acid support and transaction. Now I’m trying understand how perform query for search result in this 3-4 big data tables by terms (multiple word) in a faster way.
I’m considering Solr For store old data,I think that I can build a periodically cron job that import data from mysql into solr but but I don’t understand:
- how can I query fresh result with mysql if user search a text that has just insert a few seconds ago, from instead user search a old text insert for example 2 days ago?
and if user modify a old data:
- How can I update instantly record match on salr for to be instantly modified data visible from others user.
also
- if a user update a old data correctly on mysql (in a transaction) and immediately next application try update also data in solr for refresh with new data value but doesn’t work well, user already could see old data, not new data, because solr has already old data because update fail.
Solr has an XML interface for submitting documents to be indexed. Every time the searchable data in your application is updated, you can submit a add/update request to solr, which will then “instantly” index that data.