On 11/6/2015 8:39 PM, Yonik Seeley wrote:
> On Fri, Nov 6, 2015 at 10:20 PM, Shawn Heisey <apa...@elyograg.org> wrote:
>>  Is there a decent API for getting uniqueKey?
> Not off the top of my head.
> I deeply regret making it configurable and not just using "id" ;-)

By poking around in the admin UI with Firebug, I found something that
will work for me to get the uniqueKey field name:

        SolrQuery uniqueKeyQuery = new SolrQuery();
        uniqueKeyQuery.setRequestHandler("/admin/luke");
        uniqueKeyQuery.set("show", "schema");
        QueryResponse rsp = client.query(coreName, uniqueKeyQuery);
        String uniqueKey = (String)
rsp.getResponse().findRecursive("schema", "uniqueKeyField");

Thanks,
Shawn

Reply via email to