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.
LukeRequestHandler Examples
All of the examples in this section assume you are running the "techproducts" Solr example:
bin/solr -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.