You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Sertic Mirko, Bedag" <Mi...@bedag.ch> on 2008/11/10 14:25:44 UTC

Highlighter and Phrase Queries

Hi@all

 

I am searching for a solution to make the Highlighter run property in
combination with phrase queries.

 

I want to highlight text with a phrase query like "windows printserver",
the following highlighted:

 

"windows printservers" are good blah blah "windows" manages
"printserver" blah blah, so the phrases

and the single terms are highlighted, but I just want to highlight the
phrases. How could this be done?

 

Thanks in advance

 

Mirko

 


Re: AW: AW: Highlighter and Phrase Queries

Posted by Mark Miller <ma...@gmail.com>.
Right, it will work the same as the standard Highlighter except that it 
highlights spans and phrase queries based on position.

Sertic Mirko, Bedag wrote:
> Ok, i will do.
>
> I guess it will also work with BooleanQueries and combined Term/Wildcard/Phrase Queries?
>
> -----Ursprüngliche Nachricht-----
> Von: Mark Miller [mailto:markrmiller@gmail.com] 
> Gesendet: Montag, 10. November 2008 15:38
> An: java-user@lucene.apache.org
> Betreff: Re: AW: Highlighter and Phrase Queries
>
> Check out the unit tests for the highlighter and there are a bunch of 
> examples.
>
> Its pretty much the same as using the standard scorer, except that it 
> requires a cached token filter so that the tokenstream can be read more 
> than once.
>
> Once you pass in the SpanScorer to the Highlighter though, it works just 
> like the non phrase/span aware Highlighter.
>
>
> - Mark
>
>
> Sertic Mirko, Bedag wrote:
>   
>> Hi
>>
>> Thank you for your response.
>> Are there examples available?
>>
>> Regards
>> Mirko
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Mark Miller [mailto:markrmiller@gmail.com] 
>> Gesendet: Montag, 10. November 2008 14:45
>> An: java-user@lucene.apache.org
>> Betreff: Re: Highlighter and Phrase Queries
>>
>> Check out the SpanScorer.
>>
>> - Mark
>>
>>
>> On Nov 10, 2008, at 8:25 AM, "Sertic Mirko, Bedag" <Mirko.Sertic@bedag.ch 
>>  > wrote:
>>
>>   
>>     
>>> Hi@all
>>>
>>>
>>>
>>> I am searching for a solution to make the Highlighter run property in
>>> combination with phrase queries.
>>>
>>>
>>>
>>> I want to highlight text with a phrase query like "windows  
>>> printserver",
>>> the following highlighted:
>>>
>>>
>>>
>>> "windows printservers" are good blah blah "windows" manages
>>> "printserver" blah blah, so the phrases
>>>
>>> and the single terms are highlighted, but I just want to highlight the
>>> phrases. How could this be done?
>>>
>>>
>>>
>>> Thanks in advance
>>>
>>>
>>>
>>> Mirko
>>>
>>>
>>>
>>>     
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


AW: AW: Highlighter and Phrase Queries

Posted by "Sertic Mirko, Bedag" <Mi...@bedag.ch>.
Ok, i will do.

I guess it will also work with BooleanQueries and combined Term/Wildcard/Phrase Queries?

-----Ursprüngliche Nachricht-----
Von: Mark Miller [mailto:markrmiller@gmail.com] 
Gesendet: Montag, 10. November 2008 15:38
An: java-user@lucene.apache.org
Betreff: Re: AW: Highlighter and Phrase Queries

Check out the unit tests for the highlighter and there are a bunch of 
examples.

Its pretty much the same as using the standard scorer, except that it 
requires a cached token filter so that the tokenstream can be read more 
than once.

Once you pass in the SpanScorer to the Highlighter though, it works just 
like the non phrase/span aware Highlighter.


- Mark


Sertic Mirko, Bedag wrote:
> Hi
>
> Thank you for your response.
> Are there examples available?
>
> Regards
> Mirko
>
> -----Ursprüngliche Nachricht-----
> Von: Mark Miller [mailto:markrmiller@gmail.com] 
> Gesendet: Montag, 10. November 2008 14:45
> An: java-user@lucene.apache.org
> Betreff: Re: Highlighter and Phrase Queries
>
> Check out the SpanScorer.
>
> - Mark
>
>
> On Nov 10, 2008, at 8:25 AM, "Sertic Mirko, Bedag" <Mirko.Sertic@bedag.ch 
>  > wrote:
>
>   
>> Hi@all
>>
>>
>>
>> I am searching for a solution to make the Highlighter run property in
>> combination with phrase queries.
>>
>>
>>
>> I want to highlight text with a phrase query like "windows  
>> printserver",
>> the following highlighted:
>>
>>
>>
>> "windows printservers" are good blah blah "windows" manages
>> "printserver" blah blah, so the phrases
>>
>> and the single terms are highlighted, but I just want to highlight the
>> phrases. How could this be done?
>>
>>
>>
>> Thanks in advance
>>
>>
>>
>> Mirko
>>
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: AW: Highlighter and Phrase Queries

Posted by Mark Miller <ma...@gmail.com>.
Check out the unit tests for the highlighter and there are a bunch of 
examples.

Its pretty much the same as using the standard scorer, except that it 
requires a cached token filter so that the tokenstream can be read more 
than once.

Once you pass in the SpanScorer to the Highlighter though, it works just 
like the non phrase/span aware Highlighter.


- Mark


Sertic Mirko, Bedag wrote:
> Hi
>
> Thank you for your response.
> Are there examples available?
>
> Regards
> Mirko
>
> -----Ursprüngliche Nachricht-----
> Von: Mark Miller [mailto:markrmiller@gmail.com] 
> Gesendet: Montag, 10. November 2008 14:45
> An: java-user@lucene.apache.org
> Betreff: Re: Highlighter and Phrase Queries
>
> Check out the SpanScorer.
>
> - Mark
>
>
> On Nov 10, 2008, at 8:25 AM, "Sertic Mirko, Bedag" <Mirko.Sertic@bedag.ch 
>  > wrote:
>
>   
>> Hi@all
>>
>>
>>
>> I am searching for a solution to make the Highlighter run property in
>> combination with phrase queries.
>>
>>
>>
>> I want to highlight text with a phrase query like "windows  
>> printserver",
>> the following highlighted:
>>
>>
>>
>> "windows printservers" are good blah blah "windows" manages
>> "printserver" blah blah, so the phrases
>>
>> and the single terms are highlighted, but I just want to highlight the
>> phrases. How could this be done?
>>
>>
>>
>> Thanks in advance
>>
>>
>>
>> Mirko
>>
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


AW: Highlighter and Phrase Queries

Posted by "Sertic Mirko, Bedag" <Mi...@bedag.ch>.
Hi

Thank you for your response.
Are there examples available?

Regards
Mirko

-----Ursprüngliche Nachricht-----
Von: Mark Miller [mailto:markrmiller@gmail.com] 
Gesendet: Montag, 10. November 2008 14:45
An: java-user@lucene.apache.org
Betreff: Re: Highlighter and Phrase Queries

Check out the SpanScorer.

- Mark


On Nov 10, 2008, at 8:25 AM, "Sertic Mirko, Bedag" <Mirko.Sertic@bedag.ch 
 > wrote:

> Hi@all
>
>
>
> I am searching for a solution to make the Highlighter run property in
> combination with phrase queries.
>
>
>
> I want to highlight text with a phrase query like "windows  
> printserver",
> the following highlighted:
>
>
>
> "windows printservers" are good blah blah "windows" manages
> "printserver" blah blah, so the phrases
>
> and the single terms are highlighted, but I just want to highlight the
> phrases. How could this be done?
>
>
>
> Thanks in advance
>
>
>
> Mirko
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Highlighter and Phrase Queries

Posted by Mark Miller <ma...@gmail.com>.
Check out the SpanScorer.

- Mark


On Nov 10, 2008, at 8:25 AM, "Sertic Mirko, Bedag" <Mirko.Sertic@bedag.ch 
 > wrote:

> Hi@all
>
>
>
> I am searching for a solution to make the Highlighter run property in
> combination with phrase queries.
>
>
>
> I want to highlight text with a phrase query like "windows  
> printserver",
> the following highlighted:
>
>
>
> "windows printservers" are good blah blah "windows" manages
> "printserver" blah blah, so the phrases
>
> and the single terms are highlighted, but I just want to highlight the
> phrases. How could this be done?
>
>
>
> Thanks in advance
>
>
>
> Mirko
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org