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 Seeta Somagani <Se...@xplana.com> on 2006/02/28 16:53:56 UTC

RangeQuery or BooleanQuery?

 

Hi,

 

My documents are in the following format.

 

doc.add(new Field ("id",page, Field.Store.YES, Field.Index.TOKENIZED));

doc.add(new Field ("content",fileContent.toString(), Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.WITH_POSITIONS_OFFSETS));

 

 

I need to make a query on the content over a range of "id"s.

I have the following code in my searcher stub.

 

QueryParser queryParser = new ContextQueryParser("content", new SimpleAnalyzer());

 

Query query = queryParser.parse(queryValue);

 

Hits hits = searcher.search(query);

 

But, when I enter the query - id: [104 TO 200] content: "Marbella EspaƱa" it's just returning me all the results while ignoring the range.

I'm getting the same result, no matter which permutations of phraseQueries, BooleanQueries and TermQueries I'm entering.

 

I'd greatly appreciate any help in this regard. Thanks.

Seeta Somagani