Retrieving specific fields in a Solr query?

白昼怎懂夜的黑 提交于 2019-12-17 22:35:46

问题


I am running a Solr instance on Jetty and when I search using the Solr admin panel, it returns the entire document. What should I do to get only specified fields from each Solr document returned by the search?


回答1:


/?q=query&fl=field1,field2,field3



回答2:


From the Solr Admin home page, click on "Full Interface". On that page there is a box called "Fields to Return". You can list the you want here (comma-separated). "*" means all fields.




回答3:


http://xx.xxx.xx.xx:8983/solr/corename/select?indent=on&q=*:*&wt=json&fl=ImageID,Imagepath,Category

This link has fl parameter: fl is a field list, which will display the specified fields from the indexed list.




回答4:


The best way is to run the query from Admin concole. When we run it, it also provides the actuall SQL query executed. Just copy the query and use it.

About the question: select specific fields from the table. In the admin console look for 'FL' text box. write the field names you want to retrieve, comma sapereted. Hit the 'Execute Query' button. Top right side the SQL will be available.

Generated Query: ......select?fl=FIELDNAME&indent=on&q=:&wt=json




回答5:


you can simply pass fl parameter with required fields name in your query.

&fl=field1,field2,field3&query=:

your response documents contains only mentioned fields.



来源:https://stackoverflow.com/questions/264907/retrieving-specific-fields-in-a-solr-query

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