lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Sturlese <marc.sturl...@gmail.com>
Subject Re: configure FastVectorHihglighter in trunk
Date Wed, 27 Jan 2010 18:02:59 GMT

I am having some trouble to make it work. I am debuging the code and I see
when de  FastVectorHighlighter constructor is created, the parameters that
it recieves are ok

    // get FastVectorHighlighter instance out of the processing loop
    FastVectorHighlighter fvh = new FastVectorHighlighter(
        // FVH cannot process hl.usePhraseHighlighter parameter per-field
basis
        params.getBool( HighlightParams.USE_PHRASE_HIGHLIGHTER, true ),
        // FVH cannot process hl.requireFieldMatch parameter per-field basis
        params.getBool( HighlightParams.FIELD_MATCH, false ),
        getFragListBuilder( params ),
        getFragmentsBuilder( params ) );

The query here is ok aswell:
FieldQuery fieldQuery = fvh.getFieldQuery( query );

But I can't see what's in fieldQuery (just a memory path and don't know to
do someting similar to toString())

The problem I see is in:

        String[] snippets = highlighter.getBestFragments( fieldQuery,
req.getSearcher().getReader(), docId, fieldName,
                params.getFieldInt( fieldName, HighlightParams.FRAGSIZE, 100
),
                params.getFieldInt( fieldName, HighlightParams.SNIPPETS, 1 )
);

snippets ends up with an empty array so it jumps to:
alternateField( docSummaries, params, doc, fieldName );

In solrconfig.xml I added:
   <fragListBuilder name="simple"
class="org.apache.solr.highlight.SimpleFragListBuilder" default="false"/>
   <fragmentsBuilder name="colored"
class="org.apache.solr.highlight.MultiColoredScoreOrderFragmentsBuilder"
default="false"/>

Maybe I am missing something... any idea?
Using the doHighlightingByHighlighter highlight works perfect.

**I also have noticed that using snippet fragment size to 0 (wich in normal
highlight returns the whole field highlighted) gives an error.



Koji Sekiguchi-2 wrote:
> 
> Marc Sturlese wrote:
>> How do I activate FastVectorHighlighter in trunk? Wich of those params
>> sets
>> it up?
>>    <!-- Configure the standard fragListBuilder -->
>>    <fragListBuilder name="simple"
>> class="org.apache.solr.highlight.SimpleFragListBuilder" default="true"/>
>>
>>    <!-- Configure the standard fragmentsBuilder -->
>>    <fragmentsBuilder name="colored"
>> class="org.apache.solr.highlight.MultiColoredScoreOrderFragmentsBuilder"
>> default="true"/>
>>
>>    <fragmentsBuilder name="scoreOrder"
>> class="org.apache.solr.highlight.ScoreOrderFragmentsBuilder"
>> default="true"/>
>>
>> Thanks in advance.
>>   
> You do not need to activate it. DefaultSolrHighlighter, which is the
> "default" SolrHighlighter impl, calls automatically uses FVH when you
> specify field names that are termVectors, termPositions and termOffsets
> are true through hl.fl parameter. If you want to use "multi colored" tag
> feature, you need to specify MultiColored*FragmentsBuilder in 
> solrconfig.xml.
> 
> Koji
> 
> -- 
> http://www.rondhuit.com/en/
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/configure-FastVectorHihglighter-in-trunk-tp27319976p27344139.html
Sent from the Solr - Dev mailing list archive at Nabble.com.


Mime
View raw message