I am running solr 7.2.1
version, using SolrCloud
with a collection based on the example configuration. lucene
part of the configuration (http://localhost:8983/solr/admin/info/system?wt=yaml
) is
solr-spec-version "7.2.1"
solr-impl-version "7.2.1 b2b6438b37073bee1fca40374e85bf91aa457c0b - ubuntu - 2018-01-10 00:54:21"
lucene-spec-version "7.2.1"
lucene-impl-version "7.2.1 b2b6438b37073bee1fca40374e85bf91aa457c0b - ubuntu - 2018-01-10 00:48:43"
The terms configuration (http://localhost:8983/solr/trans/config?wt=yaml
)is:
name "terms"
class "solr.TermsComponent"
The http://localhost:8983/solr/trans/terms?wt=xml
returns:
<lst name="/terms">
<str name="startup">lazy</str>
<str name="name">/terms</str>
<str name="class">solr.SearchHandler</str>
<lst name="defaults">
<bool name="terms">true</bool>
<bool name="distrib">false</bool>
</lst><arr name="components"><str>terms</str></arr>
</lst>
Although there are 1K documents in the collection (http://localhost:8983/solr/trans/query?q=*:*&rows=0
, 2MB of text):
{
"responseHeader":{
"zkConnected":true,
"status":0,
"QTime":4,
"params":{
"q":"*:*",
"rows":"0"}},
"response":{"numFound":978,"start":0,"maxScore":1.0,"docs":[]
}}
How can I see get the terms (and their frequencies)?
If you're going to use the terms component to get all terms for a field, you have to include the field you want the terms for:
http://localhost:8983/solr/trans/terms?terms.fl=fieldname&wt=xml