How to export solr result to text file?

I need to export doc_id , all fields, socr , the rank of one search result to evaluate the results. How to do it in solr?

+6
source share
3 answers

Solr provides you with an authoring CSV answer that helps you export solr results to a csv file.

 http://localhost:8983/solr/select?q=ipod&fl=id,cat,name,popularity,price,score&wt=csv 

All requested fields will be returned by Solr in the appropriate format.

+10
source

This has nothing to do with SOLR. When you make a SOLR request over http, then SOLR searches and returns the results to you in the desired format. XML is used by default, but many people specify wt = json to get the results in json format. If you want to get this result in a text file, make your search client there.

In the browser, File โ†’ Save As.

But most people who want this to use curl as a client and use the -o option as follows:

 curl -o result1.xml 'http://solr.local:8080/solr/stuff/select?indent=on&version=2.2&q=fish&fq=&start=0&rows=10&fl=*%2Cscore&qt=&wt=&explainOther=&hl.fl=' 

Note the single quotation marks around the URL due to usage and characters.

+4
source

Solr does not have a built-in export function. The easiest way is to query the Solr instance and evaluate the XML result. See the Solr Tutorial Data Query for details on how to query the Solr result. To convert the result to a text file, I would recommend using one of the Solr clients found on the Solr Integration page in the Solr Wiki and then select your programming language to create the text file.

+1
source

Source: https://habr.com/ru/post/901773/


All Articles