Luke Request Handler
The Luke Request Handler offers programmatic access to the information provided on the Schema Browser Screen page of the Admin UI.
It is modeled after Luke, the Lucene Index Browser.
It is an implicit handler, so you don’t need to define it in solrconfig.xml.
The Luke Request Handler accepts the following parameters:
show-
Optional
Default:
allThe data about the index to include in the response. Options are
schema,index,doc,all. *allreturns all fields and high level details about the index. *indexreturns the high level details about the index without all fields. *schemareturns details about theschemaplus theindexdata. *docworks in conjunction withdocIdoridparameters and returns details about a specific document plus theindexdata. id-
Optional
Default: none
Get a document using the
uniqueKeyFieldspecified in the schema. docId-
Optional
Default: none
Get a document using a Lucene documentID.
fl-
Optional
Default: none
Limit the returned values to a set of fields. This is useful if you want to increase the
numTermsand don’t want a massive response. numTerms-
Optional
Default:
10The number of top terms for each field.
includeIndexFieldFlags-
Optional
Default:
trueChoose whether
/lukeshould return the index-flags for each field. Fetching and returning the index-flags for each field in the index has non-zero cost, and can slow down requests to/luke. distrib-
Optional
Default:
falseWhen set to
truein SolrCloud mode, the handler aggregates results from all shards in the collection. Additive index metrics (numDocs,deletedDocs,segmentCount) are summed across shards;maxDocis the maximum across shards. Field types and schema flags are validated for consistency across shards. Per-shard index details and per-field detailed statistics are returned under ashardskey.
LukeRequestHandler Examples
All of the examples in this section assume you are running the "techproducts" Solr example:
bin/solr start -e techproducts
To return summary information about the index:
http://localhost:8983/solr/techproducts/admin/luke?numTerms=0
To return schema details about the index:
http://localhost:8983/solr/techproducts/admin/luke?show=schema
To drill into a specific field manu, then you drop the show parameter and add the fl parameter:
http://localhost:8983/solr/techproducts/admin/luke?fl=manu
To see the specifics of a document using the Solr uniqueKeyField field:
http://localhost:8983/solr/techproducts/admin/luke?fl=manu&id=TWINX2048-3200PRO
Alternatively, to work through the Lucene native id:
http://localhost:8983/solr/techproducts/admin/luke?fl=manu&docId=0
From SolrJ, you can access /luke using the LukeRequest object.
Distributed Mode (multiple shards)
When running in SolrCloud, the Luke handler automatically distributes requests across all shards in the collection, the same as search requests.
To inspect only the receiving shard’s index set distrib=false.
In user-managed clusters, you can distribute across shards by passing the shards parameter with explicit shard URLs.
To get a collection-wide view:
http://localhost:8983/solr/techproducts/admin/luke
To get detailed field statistics across all shards for a specific field:
http://localhost:8983/solr/techproducts/admin/luke?fl=manu
Response Structure
In distributed mode, the response contains:
-
index— Aggregated metrics across all shards:numDocs,deletedDocs,segmentCountare summed;maxDocis the maximum across shards. -
fields— Aggregated field metadata. For each field:type,schemaflags, anddynamicBaseare validated to be consistent across shards;indexflags use the first non-null value. Thedocscount is summed. Per-field detailed statistics (topTerms,distinct,histogram) are not included at this level. -
doc— Present whenidis specified. Contains the document from whichever shard owns it, including alucenesection (per-field analysis with shard-localdocFreqvalues) and asolrsection (stored fields). Onlyidis supported for distributed doc lookup;docIdis rejected because Lucene document IDs are shard-local. -
schema— Schema information from the first responding shard (identical across shards sharing the same configset). -
info— Static info from the first responding shard. -
shards— Only present whenshards.info=true. Contains per-shard details, with each entry keyed by shard address:-
index— Full index info for that shard (includingdirectory,segmentsFile,version,current,hasDeletions,lastModified,userData). -
fields— Only present whenfltriggers detailed statistics. Contains per-fieldtopTerms,distinct, andhistogramfrom that shard.
-
Aggregation Semantics
Field type, schema flags, and dynamicBase are validated for consistency across shards.
If a mismatch is detected, the handler returns an error identifying the field, the conflicting values, and the shard addresses involved.
You can use distrib=false to query individual shards and compare their field configurations when troubleshooting mismatches.
The index flags are index-derived (not schema-derived) and may be absent on shards where the field has no indexed data; the first non-null value is used, and any subsequent non-null values are validated for consistency.
Per-field detailed statistics (topTerms, distinct, histogram) are not aggregated across shards.
These statistics are shard-local and appear in each shard’s entry under the shards key (requires shards.info=true).
For collection-wide term frequencies or cardinality estimates, Solr’s faceting API may cover some of these use cases.