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:
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?
How does solr work in combination with solrnet, solr have to get a new index of my database for each search, correct?
How to make solr indexing the data from solrnet?
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!
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.
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.
精彩评论