How can I put my custom URLs to SOLR results

廉价感情. 提交于 2019-12-11 19:46:29

问题


I am trying to index my database data with SOLR and I am successfully indexed it.

What I need is:

  • I need to put URLs with every results.
  • The URLs for each result item will be different.
  • Each result item need to append its item_id (which is available as a field) with its URL.

I am very new to SOLR configurations and SOLR query, so please help to implement a better search result XML.

Thanks in advance.


回答1:


You can store URL in an additional field (stored=true indexed=false) and then simply retrieve it when you're searching.

Even better if you can compose URLs yourself (if they differ only in ID/primary key) by appending document ID to some fixed URL, that's certainly a better way to go. That would include altering your page which displays search results.

What kind of application is your Solr integrated with? Where are those documents of yours stored? In a db? How do you get to them through your application?



来源:https://stackoverflow.com/questions/10123795/how-can-i-put-my-custom-urls-to-solr-results

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