views:

466

answers:

1

I have a field defined in schema.xml as:

<field name="id" type="integer" indexed="true" stored="true" required="true" />

It is also the uniqueKey for the schema.

I cannot perform a query on this field with the query url:

/select?q=4525&qf=id&fl=id,name%2Cscore

This returns no results, however, if I search on a different field(such as a text field), with a different query, I get many results, which include the stored id. Solr is working great for text fields, but I cannot query for items based on the unique id.

What am I missing? Are there other steps that need to be performed for indexing?

+4  A: 

Looks like you're using the qf parameter the wrong way... it's only meant to be used to boost fields in dismax queries. Use id:4525 instead, as in:

/select?q=id:4525&fl=id,name,score
Mauricio Scheffer
Thanks that got me going in the right direction.
Kekoa