Reputation: 5
I have indexed a couple of documents using solr, now when I perform a search using the admin interface, it returns search results in the XML format.
I am trying to figure out how can I associate a document that I have indexed example: test.pdf with the results that I receive and then serve that document to my user ?
Will solr return to me a unique ID of the document that I index, so that after indexing a document I can store the document along with that UID in my database somewhere and then when the user performs a search solr return the unique ID's of documents that match the search criteria and then I serve them from the database
Upvotes: 0
Views: 2297
Reputation: 32748
You will need to add the filename as a stored field. Look at your schema.xml
and make sure you declare a field of type string
and set the stored
attribute to true
. By setting stored=true
you will ensure that Solr can return the field back in results.
See this page for more information: http://wiki.apache.org/solr/SchemaXml
Upvotes: 2