Revision is a field.
Sorting is not an option because then I sort all document! I want to
filter a subset of documents with the same root version number (field)
and get only one document of the subset with highest revision number.
In other words the root revision number of all documents retrieved by
search must be unique.
E.g. If these are all my documents
<doc>
<long name="id">100000</str>
<int name="revision_number">1</int>
<long name="root_revision_id"> 100000 </long>
<.....>
<doc>
<doc>
<long name="id">100001</str>
<int name="revision_number">2</int>
<long name="root_revision_id"> 100000 </long>
<.....>
<doc>
<doc>
<long name="id">100002</str>
<int name="revision_number">1</int>
<long name="root_revision_id"> 100002 </long>
<.....>
<doc>
Search must return only documents with id=100001 and id=100002
(document with id=100000 must be ignored because 100001 has the same
root_revision_id as document with id= 100000 and the revision number
of document with id= 100001 is > revision number of document with id=
100000)
Gr, Reza
On Jul 15, 2009, at 11:52 AM, Shalin Shekhar Mangar wrote:
On Wed, Jul 15, 2009 at 3:19 PM, Reza Safari <r.saf...@lukkien.com>
wrote:
Hi,
How is possible to search for max values e.g.
doc1 has revision number 1
doc2 has revision number 2
doc3 has revision number 3
doc1, doc2 and doc3 have all same root revision id e.g. 10000
I want search result with doc's with only highest revision number?
What is "revision"? Is it a field in your Solr document?
There's no way to find max but you can always sort descending by the
revision field and take the first.
--
Regards,
Shalin Shekhar Mangar.
--
Reza Safari
LUKKIEN
Copernicuslaan 15
6716 BM Ede
The Netherlands
---------------------------------------------
http://www.lukkien.com
t: +31 (0) 318 698000
This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and delete
the original. Any other use of the email by you is prohibited.