Hi, 

 

ad 1) the highlighter branch is there, did you pull the newest version?

 

ad 2) the basic QueryScorer calls extractTerms() method on the supplied query, 
so you can use it only with queries that implement this method.

All primitive queries do implement it, Wildcard query is not a primitive query 
and so you have to call its rewrite method and use the rewritten query.

 

ad 3) the new implementation – SpanHighlightScorer – is able to rewrite the 
queries itself because it makes (if necessary) its own memoryindex 

containing just the highlighted document. The queries are rewritten using this 
small index. For a wildcard query this normally leads to a much smaller 

number of matching terms and so you avoid the max clause problem. (But of 
course, if your Wildcard query matches more than maxTerms different terms

in the highlighted text, than you have to increase this number) – How big are 
your documents?

 

Jiri

 

 

From: muhammad ismael [mailto:m.ismae...@gmail.com] 
Sent: Wednesday, January 05, 2011 7:00 PM
To: clucene-developers@lists.sourceforge.net
Subject: Re: [CLucene-dev] CLucene-developers Digest, Vol 57, Issue 4

 

        
        please could you write how you instantiate the highlighter? Which 
scorer do you use?


         m_highlightQuery = m_pMainQuery->clone(); 

        Query * q = m_highlightQuery->rewrite(m_pReader);
        m_queryScorer = new QueryScorer(q);
        m_highlighter = new Highlighter(m_queryScorer);

 

        
        Are you using the highlighter version from the highlighter branch?


No i am on master branch and i can not find highlighter branch  , i merged the 
wildcardQuery_fix and memory_leaks branches to master.

        
        I would try to find the place, where the exception is thrown.
        
        
        
        But still, there is a problem along with the ConstantScoreQuery. Both 
ways to highlight a document
        
        that are available now will not work because:
        
        1) If you use the "basic" highlighting - means you use the 
CL_NS2(search,highlight)::QueryScorer - than this scorer calls the 
extractTerms() method which is not
        
        implemented in ConstantScoreQuery  as this query uses filters to match 
documents.
        
        2 the "exact" highlighting - means you use the 
CL_NS2(search,highlight)::SpanHighlightScorer - also does not highlight 
ConstantScoreQueries for the same reason.

is this means that i can not use WildcardQuery with highlighter without setting 
the maximum clauses?
 

        But, you could use this scorer with the original WildcardQuery and 
allow rewriting queries in place. Then if your documents are not too long and
        
        the single documents does not contain  more the the max clause limit 
different matching terms, then this would work.
        
        
        
        If you want to use the new highlighter scorer then I could send you 
piece of code, how to call it.
        
        

Note :-
I can not use setMaxClauses because my documents are too long and if i use 
setMaxClauses i always get too many clauses exception 
 

Mohammad Ismael

 

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to