Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all results from solr query?

Tags:

solr

I executed some query like "Address:Jack*". It show numFound = 5214 and display 100 documents in results page(I changed default display results from 10 to 100).

How can I get all documents.

like image 276
SENTHIL SARAVANAN Avatar asked Apr 06 '12 06:04

SENTHIL SARAVANAN


People also ask

How do I query in Solr collection?

You can search for "solr" by loading the Admin UI Query tab, enter "solr" in the q param (replacing *:* , which matches all documents), and "Execute Query". See the Searching section below for more information. To index your own data, re-run the directory indexing command pointed to your own directory of documents.

How read data from Solr?

You can index this data under the core named sample_Solr using the post command. Following is the Java program to add documents to Apache Solr index. Save this code in a file with named RetrievingData. java.

What is the difference between Q and FQ in Solr?

Standard solr queries use the "q" parameter in a request. Filter queries use the "fq" parameter. The primary difference is that filtered queries do not affect relevance scores; the query functions purely as a filter (docset intersection, essentially).

What is DF in Solr query?

The df stands for default field , while the qf stands for query fields . The field defined by the df parameter is used when no fields are mentioned in the query. For example if you are running a query like q=solr and you have df=title the query itself will actually be title:solr .


1 Answers

I remember myself doing &rows=2147483647

2,147,483,647 is integer's maximum value. I recall using a number bigger than that once and having a NumberFormatException because it couldn't be parsed into an int. I don't know if they use Long nowadays, but 2 billion rows is normally more than enough.

Small note:
Be careful if you are planning to do this in production. If you do a query like * : * and your index is big, you could transferring a couple of gigabytes in that query.
If you know you won't have many docs, go ahead and use integer's max value.

On the other hand, if you are doing a one-time script and just need to dump all results (for example document ID's) then this approach is valid, if you don't mind waiting 3-5 minutes for a query to return.

like image 54
Fermin Silva Avatar answered Oct 11 '22 09:10

Fermin Silva