doco icon indicating copy to clipboard operation
doco copied to clipboard

Id is not required for a Document. The search service can automatically create an identifier

Open marcosvidolin opened this issue 11 years ago • 3 comments

Setting the document identifer is optional. If omitted, the search service will create an identifier.

marcosvidolin avatar Sep 23 '14 10:09 marcosvidolin

Any updates on this ? This would block us.

mohammedpithapurwalasc avatar Aug 07 '15 04:08 mohammedpithapurwalasc

I'd argue that setting ID is rather useful. Could you explain your scenario a little?

Also, if you really don't want a meaningful id then you can work around by not annotating any field with @DocumentId and passing a UUID while creating document. e.g.

Document myDoc = doco.toDocument(myEntity, "some-random-id-here");

tj-recess avatar Aug 07 '15 04:08 tj-recess

Yes, the uuid approach is sufficient. What I wasn't sure of is whether there is a way to specify document id (without requiring an annotation).

mohammedpithapurwalasc avatar Aug 08 '15 03:08 mohammedpithapurwalasc