Get Facetable Fields
Retrieve all indexed and stored fields from your Solr schema with automatic type classification (string, numeric, date), document counts, and any saved facet filter configuration.
Endpoint
GET https://opensolr.com/solr_manager/api/get_facetable_fields
Parameters
| Parameter | Status | Description |
|---|---|---|
email | Required | Your Opensolr registration email address |
api_key | Required | Your Opensolr API key |
core_name | Required | The name of the index to get schema fields for |
How It Works
This endpoint queries the Solr Luke handler internally on the server where your index runs (via 127.0.0.1:8080). This means it works regardless of any IP restrictions or firewall rules you have configured on your admin handlers — the query never crosses the network.
For point-based numeric and date fields (where Luke reports docs=0), a follow-up stats query is automatically executed to get accurate document counts.
Response
Each field in the response includes:
| Key | Type | Description |
|---|---|---|
field | string | The Solr field name (e.g., breadcrumbs_sm, price_f) |
type | string | Classified type: string, numeric, or date |
solr_type | string | Raw Solr type from schema (e.g., string, pfloat, pdate) |
multi | boolean | Whether the field is multi-valued |
label | string | Human-readable label (auto-generated or from saved config) |
docs | integer | Number of documents containing this field |
enabled | boolean | Whether this field is enabled as a facet filter (from saved config) |
widget | string | Widget type: list, slider, or date_range (from saved config) |
weight | integer | Display order weight (lower = first, from saved config) |
Code Examples
cURL
curl -s "https://opensolr.com/solr_manager/api/get_facetable_fields?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_solr_core"
PHP
$params = http_build_query([ 'email' => 'YOUR_EMAIL', 'api_key' => 'YOUR_API_KEY', 'core_name' => 'my_solr_core', ]); $response = file_get_contents("https://opensolr.com/solr_manager/api/get_facetable_fields?{$params}"); $data = json_decode($response, true); // List all fields with docs foreach ($data['fields'] as $field) { if ($field['docs'] > 0) { echo $field['field'] . " ({$field['type']}, {$field['docs']} docs)\n"; } }
Python
import requests response = requests.get("https://opensolr.com/solr_manager/api/get_facetable_fields", params={ "email": "YOUR_EMAIL", "api_key": "YOUR_API_KEY", "core_name": "my_solr_core", }) data = response.json() # Print fields with data for field in data["fields"]: if field["docs"] > 0: print(f"{field['field']} ({field['type']}, {field['docs']:,} docs)")
Example Response
{ "status": true, "fields": [ { "field": "breadcrumbs_sm", "type": "string", "solr_type": "string", "multi": true, "label": "Breadcrumbs", "docs": 45200, "enabled": true, "widget": "list", "weight": 0 }, { "field": "price_f", "type": "numeric", "solr_type": "pfloat", "multi": false, "label": "Price", "docs": 38100, "enabled": true, "widget": "slider", "weight": 1 }, { "field": "brand_sm", "type": "string", "solr_type": "string", "multi": true, "label": "Brand", "docs": 42000, "enabled": false, "widget": "list", "weight": 999 } ] }
enabled, widget, label, and weight values reflect any saved facet configuration from the Index Settings panel. Fields that haven't been configured yet show enabled: false and weight: 999. Use the Search Facet Filters section in your Index Settings to configure them visually, or build your own UI using this API.Use Cases
- Build a custom facet sidebar — Query this endpoint to discover available fields, then add
facet.fieldorstats.fieldparameters to your Solr queries - Dynamic filter UIs — Auto-generate filter dropdowns, sliders, or date pickers based on the field types returned
- Schema discovery — Inspect what structured data the crawler extracted from your pages (breadcrumbs, product attributes, ratings, etc.)
- Monitoring — Track which fields have data and how many documents contain each field
Related Documentation
Need help with the Opensolr Web Crawler? We are here to help.
Contact SupportPaste any website URL into the RAG in 60 Seconds sandbox. The Web Crawler fetches your pages, Opensolr generates the vector embeddings, and you get keyword + vector hybrid search plus a RAG answer on your own content — live, on a temporary index, with the keyword-only, vector-only and hybrid results shown side by side. No account, no OpenAI key, nothing to install.
Try AI Hybrid Search in 60 seconds →