3

I am working on adding the search capabilities for an e-commerce project and I need to integrate the Apache Solr search server for the searching. I was able to index the site content with Apache Solr, but the problem is whenever a user is searching all the product content is indexed in the apache solr even if it has been indexed already. Is there any way in which I can find out if my content has already been indexed by Apache Solr so that I need not index the content again

Thanks

1 Answers1

3

If you are holding data in DB and then indexing it with Solr the solution is easy. Add timestamp column to the data in DB, and Solr. Then periodically check latest timestamps in both. When they are not equal, add to index content with newer timestamp.

You can do that with correct query in DIH. For more read:

Community
  • 1
  • 1
Fuxi
  • 5,298
  • 3
  • 25
  • 35
  • Fuxi, thank you for sharing the links with me, they were very helpful. Yes, I am using a database to store the records and getting them indexed, but I don't yet know how to work with date fields with Solr, can you share any information regarding this – user1163415 Jan 22 '12 at 14:49
  • Solr is indexing dates from DB without any special actions need by you. Solr is using ISO 8601 dateformat. In http://stackoverflow.com/questions/8654871/solr-delta-import-timestamp-issue/8656176 you have all info in comments. Please specify how can I help more – Fuxi Jan 22 '12 at 19:21