<div dir="ltr"><div>I checked out the latest code and it works fine now. Could you please guide me on what else can I do to contribute to the community. I am comfortable working with python and Java and have a decent understanding of C++<br><br>Thanks</div><div>Shiv</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 16, 2016 at 5:43 PM, James Aylett <span dir="ltr"><<a href="mailto:james-xapian@tartarus.org" target="_blank">james-xapian@tartarus.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[Please keep replies on list, so that everyone can help and benefit.]<br>
<span class=""><br>
On 15 Feb 2016, at 20:39, Shiv Kandikuppa <<a href="mailto:shiv12095@iiitd.ac.in">shiv12095@iiitd.ac.in</a>> wrote:<br>
<br>
> I initially misunderstood the guide and wrongly tried the above steps. Now I have gone over the documentation for the parts pertaining to indexing, searching and range queries.<br>
<br>
</span>Great.<br>
<span class=""><br>
> I could not understand the part [The xapian.DateValueRangeProcessor is working on value slot 2, with an “epoch” of 1860 (so two digit years will be considered as starting at 1860 and going forward as far 1959).]. I have tried the command:<br>
><br>
> python code/python/search_ranges2.py statesdb 61..64<br>
><br>
> hoping to get all states that were admitted between 1861 and 1864 but instead got the output as INFO:xapian.search:'61..64'[0:100]<br>
><br>
> Could you help me as to how do we use the 2 digit years in our range queries.<br>
<br>
</span>Okay, this isn’t quite as clear as it should be in the documentation. The _DateValueRangeProcessor_, operating on slot 2, is dealing with dates in the form “mm/dd/yy” and “mm/dd/yyyy”, and that’s the one that copes with two-digit years. The _NumberValueRangeProcessor_, operating on slot 1, and doesn’t have this feature (because it doesn’t know anything about dates or years).<br>
<br>
If you needed this functionality, you could write a custom _ValueRangeProcessor_ to do the processing, like _PopulationValueRangeProcessor_ at the end of the section. (You’d want to make the adjustments in `__call__()` before calling to the wrapped _NumberValueRangeProcessor_.)<br>
<br>
I’ll see if I can improve the way that part’s written so it’s less confusing.<br>
<span class=""><br>
> python code/python/search_ranges2.py statesdb 10..<br>
><br>
> causes an Exception<br>
>   File "code/python/search_ranges2.py", line 97, in <module><br>
>     search(dbpath = sys.argv[1], querystring = " ".join(sys.argv[2:]))<br>
>   File "code/python/search_ranges2.py", line 72, in search<br>
>     population = support.format_numeral(fields.get('population', 0))<br>
>   File "/home/shiv/Xapian-doc/xapian-docsprint/code/python/support.py", line 140, in format_numeral<br>
>     raise ValueError("Numeral must be an int type to format")<br>
> ValueError: Numeral must be an int type to format<br>
<br>
</span>That’s a problem with the states dataset, which I’ve now fixed; if you update from github it should work properly. Sorry about that!<br>
<div class="HOEnZb"><div class="h5"><br>
J<br>
<br>
--<br>
 James Aylett, occasional trouble-maker<br>
 <a href="http://xapian.org" rel="noreferrer" target="_blank">xapian.org</a><br>
<br>
</div></div></blockquote></div><br></div>