lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Highlighting with prefix queries and maxBooleanClause
Date Sun, 01 Jan 2012 15:48:18 GMT
This may be the impetus for Hoss creating SOLR-2996.

I suspect this will go away if you use the correct
match-all-docs syntax, i.e. q=*:* rather than q=*

Hoss' suggestion in 2996 is to "do the right thing" with
q=*, but for now you need to use the right syntax.

But I'm not sure what highlighting will do when there's
nothing to highlight on (ie, no query terms to match
against your text field).

FWIW
Erick

On Fri, Dec 30, 2011 at 6:00 PM, Michael Lissner
<mlissner@michaeljaylissner.com> wrote:
> This question has come up a few times, but I've yet to see a good solution.
>
> Basically, if I have highlighting turned on and do a query for q=*, I get an
> error that maxBooleanClauses has been exceeded. Granted, this is a silly
> query, but a user might do something similar. My expectation is that queries
> that work when highlighting is OFF should continue working when it is ON.
>
> What's the best solution for queries like this? Is it simply to catch the
> error and then up maxBooleanClauses? Or to turn off highlighting when this
> error occurs?
>
> Or am I doing something altogether wrong?
>
> This is the query I'm using to cause the error:
>    http://localhost:8983/solr/select/?q=*&start=0&rows=20&hl=true&hl.fl=text
>
> Changing hl to false makes the query go through.
>
> I'm using Solr 4.0.0-dev
>
> The traceback is:
>
> SEVERE: org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount
> is set to 1024
>    at
> org.apache.lucene.search.ScoringRewrite$1.checkMaxClauseCount(ScoringRewrite.java:68)
>    at
> org.apache.lucene.search.ScoringRewrite$ParallelArraysTermCollector.collect(ScoringRewrite.java:159)
>    at
> org.apache.lucene.search.TermCollectingRewrite.collectTerms(TermCollectingRewrite.java:81)
>    at
> org.apache.lucene.search.ScoringRewrite.rewrite(ScoringRewrite.java:114)
>    at
> org.apache.lucene.search.MultiTermQuery.rewrite(MultiTermQuery.java:312)
>    at
> org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:155)
>    at
> org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:144)
>    at
> org.apache.lucene.search.highlight.WeightedSpanTermExtractor.getWeightedSpanTerms(WeightedSpanTermExtractor.java:384)
>    at
> org.apache.lucene.search.highlight.QueryScorer.initExtractor(QueryScorer.java:216)
>    at
> org.apache.lucene.search.highlight.QueryScorer.init(QueryScorer.java:184)
>    at
> org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlighter.java:205)
>    at
> org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByHighlighter(DefaultSolrHighlighter.java:511)
>    at
> org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(DefaultSolrHighlighter.java:402)
>    at
> org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:121)
>    at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194)
>    at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
>    at org.apache.solr.core.SolrCore.execute(SolrCore.java:1478)
>    at
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:353)
>    at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:248)
>    at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
>    at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
>    at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>    at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>    at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
>    at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>    at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>    at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>    at org.mortbay.jetty.Server.handle(Server.java:326)
>    at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>    at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
>    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
>    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
>    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>    at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>    at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>
> Thanks,
>
> Mike

Mime
View raw message