What's the best approach for using SOLR with web projects?

后端 未结 2 677
野的像风
野的像风 2021-02-06 12:58

ok, I\'m totally new to SOLR and Lucene, but have got Solr running out-of-the-box under Tomcat 6.x and have just gone over some of the basic Wiki entries.

I have a few q

相关标签:
2条回答
  • 2021-02-06 13:23

    I think Mauricio is dead on for his advice. The only point I would make is that when deciding to have a "middleware" indexer, or use the database directly. If your database (or the views?) map very closely to what a good Solr schema wants, then DIH is great. But, if you are indexing from multiple sources of data, or if you have to munge about the data in your database to meet what Solr would like, then having a dedicated middleware indexer is better.

    0 讨论(0)
  • 2021-02-06 13:35
    1. No, you need a crawler for that, e.g. Nutch
    2. Yes, you want two separate indexes ( = two schema.xml) since the datasets don't seem to be related. This doesn't mean two instances of Solr, you can manage the two indexes with Cores.

    As for populating the Solr index, it depends on your particular project, for example, can it tolerate stale data or does it have to absolutely fresh.

    Other options to index data include:

    • Database triggers
    • If you're using some sort of ORM use its interception capabilities. For example you can use NHibernate events to update the index on update, insert or delete. If you use NHibernate and SolrNet this is taken care of automatically
    0 讨论(0)
提交回复
热议问题