On 3/14/06, Mordo, Aviran (EXP N-NANNATEK) <[EMAIL PROTECTED]> wrote: > You need to index the field as a keyword, or use an analyzer that will > not strip the / from the string > > Aviran > http://www.aviransplace.com
Field is indexed as Keyword, I was using StandardAnalyzer(), but currently I try to send queries directly via API, so I use this code for doing job: PrefixQuery query1 = null; if(cat!=""){ Term term = new Term("category",cat); query1 = new PrefixQuery(term); Hits hits = is.search(query1); } Variable cat takes path like strings as arguments so eg it gets: Top/World/Poland/ which is translated into: category:Top/World/Poland/* Everything started to work, but I get such Exception: org.apache.lucene.search.BooleanQuery$TooManyClauses org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:79) org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:71) org.apache.lucene.search.PrefixQuery.rewrite(PrefixQuery.java:50) org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:166) org.apache.lucene.search.Query.weight(Query.java:84) org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:85) org.apache.lucene.search.Hits.getMoreDocs(Hits.java:64) org.apache.lucene.search.Hits.<init>(Hits.java:43) org.apache.lucene.search.Searcher.search(Searcher.java:33) org.apache.lucene.search.Searcher.search(Searcher.java:27) when I cut the path, so in other words - I don't get exception when query is Top/World/Poland/ but I start to get them when query is Top/World/. I have also getMaxClauseCount() = 1024. Lucene probably try to find all keywords which are good for Top/World/* and put them in boolean query, am I right? If yes, I have problem because from root category there are about 3-4kk children categories, which I also want to search (and show category as url, so user could get deeper in category tree if he wants). What can I do with this, besides set up higher values in maxClauseCount? Best Regards, Adr --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]