2
votes

I’m programming en ASP MVC3 application. One part of that application should be a product list containing faceted search, full text search and distance search. After a while of research I found SOLR and SOLRNet. I have installed Solr on a Tomcat 7 and included a DataImportHandler for Indexing data from my MS SQL database. Now I have a problem perhaps only an understanding problem:

  1. The facets I want to use are placed in the database and could change every time. Where I have to implement the facet indexing? In the ASP MVC application or in the data-config of solr?

  2. How does solr work in combination with solrnet, solr have to get a new index of my database for each search, correct?

  3. How to make solr indexing the data from solrnet?

  4. Have I to rebuild the index after every change?

A lot of questions and I would be happy if someone knows the answer of some of them. Thank you very much and have a nice weekend!

2
I would suggest Tomcat 6, as I read in too many places the 7th has issues. Might be wrong thoughItay Moav -Malimovka

2 Answers

2
votes

The facets I want to use are placed in the database and could change every time. Where I have to implement the facet indexing? In the ASP MVC application or in the data-config of solr?

You mentioned you already set up DataImportHandler to index your data, so populating the index is just a matter of running a scheduled full-import or delta-import.

How does solr work in combination with solrnet, solr have to get a new index of my database for each search, correct?

No, you don't need to recreate the index for every search.

How to make solr indexing the data from solrnet?

You mentioned you already set up DataImportHandler to index your data, that's a valid approach to populate your index by having Solr pull data from the database. If you want to push data to your index using SolrNet instead, use the Add/AddRange methods.

0
votes

The facets I want to use are placed in the database and could change every time. Where I have to implement the facet indexing? In the ASP MVC application or in the data-config of solr?

Solr provides out of the box faceting.
you would index the data you need to facet in schema.xml and enable faceting during the searches in solrconfig.xml.
On the application side you just need to process the facet data return by Solr.

http://www.lucidimagination.com/devzone/technical-articles/faceted-search-solr

How does solr work in combination with solrnet, solr have to get a new index of my database for each search, correct?

Usually the client (java and ruby) interacts with Solr through http executing searches and processing the results providing you an easy access.
So everytime the search happens Solrnet would be querying the latest index.

Have I to rebuild the index every change?

With Data import handler you can incrementally index you data periodically.
The timestamp handling is performed for you by Solr.
You would need to have jobs which would perform the incremental indexing.
However, if you need to have the data reflected with every change you would need to index the data through application.

Dataimporthandler, with Solr on Tomcat 7 should work fine. Check the jdk version as jdk 7 had some issues with Solr/Lucene.