I need to Feed some data into the solr , so far i have seen process of feeding data is , Create schema.xml and feed data in particular fields into solr and index it using any client library.
I have some different kind of requirement. I have a MongoCollection , it has many fields , some nested arrays and also some dynamic key-value inside hese array.
i want to feed exact structure into the solr and also index it , so that when i retrive the data using keyword search , i should be able to get the document in the same structure.
That all what i need it any how , so first question is , is that kind of stuff is possible with solr or not?
If yes please share some references or any help.
Thanks in advance.
Try using "schemaless mode", though it will not give exactly what you asked for. https://cwiki.apache.org/confluence/display/solr/Schemaless+Mode https://cwiki.apache.org/confluence/display/solr/Schema+Factory+Definition+in+SolrConfig
You can also look at "nested documents" but you may need to restructure your data before POSTing to Solr. http://yonik.com/solr-nested-objects/
You may want to search in Solr to get a document ID, then use it to retrieve the original document from MongoDB.
It depends on your needs. Do you realy need to search or filter on every attribute from an mongoDB object?
Or do you only need to search an keyword (which is part of the mongoDB document/object) in order to return the original mongoDB document/object, which is mostly an JSON-string?
If the 2nd case fits, so you could set up your solr with only two fields: one field for the mongoDB-Object ID and one mutlivalue textfield for the mongoDB document.