lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dedian Guo" <gded...@gmail.com>
Subject [newbie]problem about range query
Date Mon, 03 Apr 2006 19:13:52 GMT
I used following code to do my range searching:

        IndexSearcher searcher = new IndexSearcher("index");
        String qstr = "id:[1 TO 2]";
        Analyzer analyzer = new StandardAnalyzer();
        QueryParser qp = new QueryParser("title",analyzer);
        Query query = qp.parse(qstr);
        Hits hits = searcher.search(query,null);

but i met follow error messages:

Exception in thread "main"
org.apache.lucene.search.BooleanQuery$TooManyClauses
    at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:184)
    at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:175)
    at org.apache.lucene.search.RangeQuery.rewrite(RangeQuery.java:94)
    at org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java
:137)
    at org.apache.lucene.search.Query.weight(Query.java:92)
    at org.apache.lucene.search.Hits.<init>(Hits.java:48)
    at org.apache.lucene.search.Searcher.search(Searcher.java:53)

could anybody give me some thought?

thanks,

P.S. BTW, the id field is indexed as string, such as 1, 2, 3, ...., 1000,
....

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message