Solr: Retrieve field names from a solr index?

Use the luke handler:

http://solr:8983/solr/admin/luke?numTerms=0

Use a xpath to get all the field which has the tag dynamicBase matching the dynamic fields definition you are looking for.


This query will return a comma-separated list of all the fields that are in use, including dynamic ones.

select?q=*:*&wt=csv&rows=0&facet

To answer the original question, this is how to get a list of all the fields starting with category_

select?q=*:*&wt=csv&rows=0&facet&fl=category_*

The presence of the facet parameter is needed to make this query work on newer versions of Solr. On older versions, it will work without it.

On older versions, a wildcard in the fl parameter won't work.

Tags:

Solr