shay te
shay te

Reputation: 1068

solr don't send the id field with the result

i am pretty new to solr. and i don't know what is the best practice for the id column.

currently i wish to exclude the internal "id" parameter from solr search results (i am using my custom user_id field ).

i know i can use the fl=field1,field2. but this means specifying all my fields here. and i don't have a deep knowledge in solr and i fear this will hurt performance. ?

another question is it recommended to add another field user_id or overwrite the default id field ?

thank you very much.

Upvotes: 0

Views: 67

Answers (1)

MatsLindh
MatsLindh

Reputation: 52892

If the value you have in your user_id field is unique, index that into your id column or define the user_id field as your unique key instead and don't use the id field.

The important thing is that there's a unique field in your document so that Solr knows when a document should be updated compared to when a new document should be added instead.

If the id field is not relevant / secret, I'm not sure why you'd be worried about including it.

Upvotes: 1

Related Questions