lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eduardo Pierdant" <>
Subject Question: searching on a NumericField, with sort and filter
Date Tue, 06 Jul 2010 17:49:00 GMT

Hi all.

I've been dealing  with a small problem when searching and trying to sort
and filter on a NumericField using Lucene 2.9.2; the result never comes back
as expected. Here are some snippets of my code, so you might take a look and
reference me  or help me out to solve this problem.

At document creation, I add the field like this:
 	doc.add(new NumericField("PuntosJobSense", Field.Store.YES,

When searching, I use a sort field and a Filter:

	SortField sf = new SortField("PuntosPatrocinadas", SortField.INT,
	Sort sortOrder = new Sort(sf);
	Filter nf = NumericRangeFilter.newIntRange("PuntosPatrocinadas", 0,
Integer.MAX_VALUE, true, true);
	hits =, nf, MAX_DOC_SEARCH,

the only "query" parameter that I'm passing so far is "date modified" that
uses the date the document was added to the index. If I don't use this
search and simply search without filter nor sorting, everything is ok.

Hope someone can help me out.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message