I have a Ember.js app that can generate html templates that i then want to save as html.
For each of these templates i will be searching through then via solr via sunspot gem.
When a user searches, i want solr to return the results and then also return the template html for each of the results to display.
I am using mongodb to store data but not sure to store html documents into mongodb, on the file system or in solr itself.
If i save them into mongo when i get the results back from solr i then have an extra step to query mongodb.
Anyone got any experience with this sort of thing ?
Any help or suggestion would be great!
thanks Rick
We have a similar setup, ASP.NET MVC4 application, backed by MongoDb and Solr.
We use Mongo to store data + template (we use Mustache for templating). Outside Solr, we simply query Mongo for data+template, compile the Mustache template with the data JSON and render it.
For SOLR, we store( indexed=false
) the compiled HTML along with other structured data ( stored=true indexed=true
) for a document. This helps us avoid additional query to Mongo, and also allows us to use Facets on the document.
If you store the HTML in Mongo, and you intend to have facets, you will be looking at at least one extra Mongo query, per facet choice.
SOLR is good enough to store html as text, I would not index it, when I have structured data for the document.