Solr return file name

2020-05-07 04:03发布

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

标签: solr indexing
1条回答
Summer. ? 凉城
2楼-- · 2020-05-07 04:44

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

查看更多
登录 后发表回答