Solr return file name

吃可爱长大的小学妹 提交于 2019-12-20 06:29: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


回答1:


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



来源:https://stackoverflow.com/questions/8390972/solr-return-file-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!