You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Todd Nine <to...@spidertracks.co.nz> on 2010/09/17 04:39:01 UTC

Filtering times stored as longs in HEX

Hi all,
  I'm using Lucandra to index notes in our system.  Since we can't use
numeric fields due to a bug in Cassandra (fixed in 0.7), I'm encoding
all times a epoch in Hex, then storing the hex string.  I have the
following fields on my document.

createdDate
phoneNumber
email


I want to perform a query where the input is either a phone number, or
an email.  The user also passes in an epoch timestamp (long in
milliseconds), and the count.  I need to return all documents with a
timestamp <= the given timestamp, and the maximum count.  I'm having
some trouble building this query in my code.  I never get any results,
but I can see the data is written to the index properly.  Here is my
code.

http://pastie.org/private/xzvnntmyjzxgpjgctxftrq



Thanks,
Todd





Re: Filtering times stored as longs in HEX

Posted by Ian Lea <ia...@gmail.com>.
>From a quick look your code looks fine, but there are various possible
reasons why you might not be getting the results you expect.
http://wiki.apache.org/lucene-java/LuceneFAQ#Why_am_I_getting_no_hits_.2BAC8_incorrect_hits.3F

Are the email and phone numbers stored as is, or analyzed?  Does it
work if you remove the date filter?  Are the hex encoded strings the
same length and in the right sequence?

Posting a complete standalone test case or program, as small as you
can make it while demonstrating the problem, can make it easier for
people to spot problems.


--
Ian.


On Fri, Sep 17, 2010 at 3:39 AM, Todd Nine <to...@spidertracks.co.nz> wrote:
> Hi all,
>  I'm using Lucandra to index notes in our system.  Since we can't use
> numeric fields due to a bug in Cassandra (fixed in 0.7), I'm encoding
> all times a epoch in Hex, then storing the hex string.  I have the
> following fields on my document.
>
> createdDate
> phoneNumber
> email
>
>
> I want to perform a query where the input is either a phone number, or
> an email.  The user also passes in an epoch timestamp (long in
> milliseconds), and the count.  I need to return all documents with a
> timestamp <= the given timestamp, and the maximum count.  I'm having
> some trouble building this query in my code.  I never get any results,
> but I can see the data is written to the index properly.  Here is my
> code.
>
> http://pastie.org/private/xzvnntmyjzxgpjgctxftrq
>
>
>
> Thanks,
> Todd
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org