Hi all,
  I'm having some issues with Numeric Range queries not working as
expected.  My underlying storage medium is the Lucandra index reader and
writer, so I'm not sure if this is an issue within Lucandra or with my
usage of numeric field.  My numeric range tests that are copies of Uwe's
pass in the Lucandra, source, so I have a feeling it's my usage.  I have
a simple test case, with 5 people.  I have a Date field, the LastLogin
field.  This date is converted to epoch milliseconds, and stored in the
index in the following way.

NumericField numeric = new NumericField("LastLogin");
numeric.setLongValue(fieldValue);
doc.add(numeric);

Where I have the following 2 field values on 2 documents.

1282197146L and 1282197946L

I then perform the following query.

NumericRangeQuery rangeQuery =
NumericRangeQuery.newLongRange("LastLogin", 1282197146L, 1282197146L,
true, true);

IndexReader reader = new IndexReader(columnFamily,
                                                getContext(conn));
                                IndexSearcher searcher = new 
IndexSearcher(reader);

                                TopDocs docs = searcher.search(query, 
maxResults);

                                List<Document> documents = new 
ArrayList<Document>(
                                                docs.totalHits);

                                Set<String> fields = new HashSet<String>();
                                fields.add(IndexDocument.ROWKEY);
                                fields.add(IndexDocument.IDSERIALIZED);

                                SetBasedFieldSelector selector = new 
SetBasedFieldSelector(
                                                fields, null);

                                for (ScoreDoc score : docs.scoreDocs) {
                                        
documents.add(reader.document(score.doc, selector));
                                }

                                return documents;

I'm always getting 0 documents.  I know this is incorrect, I can see the
values getting written to Cassandra when I run it in debug mode.  Is
this an issue with precision step, or an issue with the Lucandra index
reader implementation?

Thanks,
Todd

Reply via email to