lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <apa...@elyograg.org>
Subject Re: Is it impossible to update an index that is undergoing an optimize?
Date Mon, 09 Nov 2015 16:15:41 GMT
On 11/6/2015 8:39 PM, Yonik Seeley wrote:
> On Fri, Nov 6, 2015 at 10:20 PM, Shawn Heisey <apache@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


Mime
View raw message