0

If my solr documents has a

<field name="timestamp" type="solr.TrieDateField" indexed="true" stored="true"  required="true" multiValued="false"/>

how can i query for the most recent document?

Only way I've discovered so far is to sort by descending date and limit rows to 1 but that has some limitations when i want something like get the most recent version of documents with id 1,2,3,4

something similar to this Get records with highest/smallest <whatever> per group

Community
  • 1
  • 1
AgentRegEdit
  • 1,089
  • 2
  • 16
  • 32

1 Answers1

2

I seem to have gotten the results im looking for by using a solr group query

  group=true&group.field=groupId&group.sort=timestamp desc
AgentRegEdit
  • 1,089
  • 2
  • 16
  • 32