You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by David Snelling <da...@donorschoose.org> on 2008/09/23 22:47:55 UTC

Highlight Fragments

Ok, I'm very frustrated. I've tried every configuraiton I can and parameters
and I cannot get fragments to show up in the highlighting in solr. (no
fragments at the bottom or highlights <em></em> in the text. I must be
missing something but I'm just not sure what it is.

/select/?qt=standard&q=crayon&hl=true&hl.fl=synopsis,shortdescription&hl.fragmenter=gap&hl.snippets=3&debugQuery=true

And I get highlight segment, but no fragments or phrase highlighting.

My goal - if I'm doing this completely wrong - is to get google like
snippets of text around the query term (or at mimimum to highlight the query
term itself).

Results:
<lst name="params">
<str name="fl">synopsis</str>
<str name="debugQuery">true</str>
<str name="hl.snippets">3</str>
<str name="hl.fragmenter">gap</str>
<str name="q">crayon</str>
<str name="hl.fl">synopsis</str>
<str name="qt">standard</str>
<str name="hl">true</str>
<str name="version">2.1</str>
</lst>
</responseHeader>
−
<result name="response" numFound="237" start="0">
−
...........
.........
..........
</result>
<lst name="highlighting">
<lst name="206738"/>
<lst name="184583"/>
<lst name="203809"/>
<lst name="201588"/>
<lst name="207554"/>
<lst name="157569"/>
<lst name="199682"/>
<lst name="196359"/>
<lst name="202940"/>
<lst name="190672"/>
</lst>

-- 
"hic sunt dracones"

Re: Highlight Fragments

Posted by wojtekpia <wo...@hotmail.com>.
Yes, you can use text (or some custom derivative of it) for your fields. 


David Snelling-2 wrote:
> 
> Ok, thanks, that makes a lot of sense now.
> So, how should I be storing the text for the synopsis or shortdescription
> fields so it would be tokenized? Should it be text instead of string?
> 
> 
> Thank you very much for the help by the way.
> 
> 
> On Tue, Sep 23, 2008 at 2:49 PM, wojtekpia <wo...@hotmail.com> wrote:
> 
>>
>> Your fields are all of string type. String fields aren't tokenized or
>> analyzed, so you have to match the entire text of those fields to
>> actually
>> get a match. Try the following:
>>
>> /select/?q=firstname:Kathryn&hl=on&hl.fl=firstname
>>
>> The reason you're seeing results with just q=students, but not
>> q=synopsis:students is because you're copying the synopsis field into
>> your
>> field named 'text', which is of type 'text', which does get tokenized and
>> analyzed, and 'text' is your default search field.
>>
>> The reason you don't see any highlights with the following query is
>> because
>> your 'text' field isn't stored.
>>
>> select/?q=text:students&hl=on&hl.fl=text
>>
>>
>>
>>
>>
>> David Snelling-2 wrote:
>> >
>> > Hmmm. That doesn't actually return  anything which is odd because I
>> know
>> > it's in the field if I do a query without specifying the field.
>> >
>> > http://qasearch.donorschoose.org/select/?q=synopsis:students
>> >
>> > returns nothing
>> >
>> > http://qasearch.donorschoose.org/select/?q=students
>> >
>> > returns items with query in synopsis field.
>> >
>> > This may be causing issues but I'm not sure why it's not working. We
>> use
>> > this live and do very complex queries including facets that work fine.
>> >
>> > www.donorschoose.org
>> >
>> >
>> >
>> > On Tue, Sep 23, 2008 at 2:20 PM, wojtekpia <wo...@hotmail.com>
>> wrote:
>> >
>> >>
>> >> Try a query where you're sure to get something to highlight in one of
>> >> your
>> >> highlight fields, for example:
>> >>
>> >>
>> >>
>> /select/?qt=standard&q=synopsis:crayon&hl=true&hl.fl=synopsis,shortdescription
>> >>
>> >>
>> >>
>> >> David Snelling-2 wrote:
>> >> >
>> >> > This is the configuration for the two fields I have tried on....
>> >> >
>> >> > <field name="shortdescription" type="string" indexed="true"
>> >> > stored="true"/>
>> >> > <field name="synopsis" type="string" indexed="true" stored="true"
>> >> > compressed="true"/>
>> >> >
>> >> >
>> >> >
>> >> > On Tue, Sep 23, 2008 at 1:59 PM, wojtekpia <wo...@hotmail.com>
>> >> wrote:
>> >> >
>> >> >>
>> >> >> Make sure the fields you're trying to highlight are stored in your
>> >> schema
>> >> >> (e.g. <field name="synopsis" type="string" stored="true" />)
>> >> >>
>> >> >>
>> >> >>
>> >> >> David Snelling-2 wrote:
>> >> >> >
>> >> >> > Ok, I'm very frustrated. I've tried every configuraiton I can and
>> >> >> > parameters
>> >> >> > and I cannot get fragments to show up in the highlighting in
>> solr.
>> >> (no
>> >> >> > fragments at the bottom or highlights <em></em> in the text. I
>> must
>> >> be
>> >> >> > missing something but I'm just not sure what it is.
>> >> >> >
>> >> >> >
>> >> >>
>> >>
>> /select/?qt=standard&q=crayon&hl=true&hl.fl=synopsis,shortdescription&hl.fragmenter=gap&hl.snippets=3&debugQuery=true
>> >> >> >
>> >> >> > And I get highlight segment, but no fragments or phrase
>> >> highlighting.
>> >> >> >
>> >> >> > My goal - if I'm doing this completely wrong - is to get google
>> like
>> >> >> > snippets of text around the query term (or at mimimum to
>> highlight
>> >> the
>> >> >> > query
>> >> >> > term itself).
>> >> >> >
>> >> >> > Results:
>> >> >> > <lst name="params">
>> >> >> > <str name="fl">synopsis</str>
>> >> >> > <str name="debugQuery">true</str>
>> >> >> > <str name="hl.snippets">3</str>
>> >> >> > <str name="hl.fragmenter">gap</str>
>> >> >> > <str name="q">crayon</str>
>> >> >> > <str name="hl.fl">synopsis</str>
>> >> >> > <str name="qt">standard</str>
>> >> >> > <str name="hl">true</str>
>> >> >> > <str name="version">2.1</str>
>> >> >> > </lst>
>> >> >> > </responseHeader>
>> >> >> > −
>> >> >> > <result name="response" numFound="237" start="0">
>> >> >> > −
>> >> >> > ...........
>> >> >> > .........
>> >> >> > ..........
>> >> >> > </result>
>> >> >> > <lst name="highlighting">
>> >> >> > <lst name="206738"/>
>> >> >> > <lst name="184583"/>
>> >> >> > <lst name="203809"/>
>> >> >> > <lst name="201588"/>
>> >> >> > <lst name="207554"/>
>> >> >> > <lst name="157569"/>
>> >> >> > <lst name="199682"/>
>> >> >> > <lst name="196359"/>
>> >> >> > <lst name="202940"/>
>> >> >> > <lst name="190672"/>
>> >> >> > </lst>
>> >> >> >
>> >> >> > --
>> >> >> > "hic sunt dracones"
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >> http://www.nabble.com/Highlight-Fragments-tp19636705p19636915.html
>> >> >> Sent from the Solr - User mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > "hic sunt dracones"
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Highlight-Fragments-tp19636705p19637261.html
>> >> Sent from the Solr - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > "hic sunt dracones"
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Highlight-Fragments-tp19636705p19637801.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> "hic sunt dracones"
> 
> 

-- 
View this message in context: http://www.nabble.com/Highlight-Fragments-tp19636705p19638296.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Highlight Fragments

Posted by David Snelling <da...@donorschoose.org>.
Ok, thanks, that makes a lot of sense now.
So, how should I be storing the text for the synopsis or shortdescription
fields so it would be tokenized? Should it be text instead of string?


Thank you very much for the help by the way.


On Tue, Sep 23, 2008 at 2:49 PM, wojtekpia <wo...@hotmail.com> wrote:

>
> Your fields are all of string type. String fields aren't tokenized or
> analyzed, so you have to match the entire text of those fields to actually
> get a match. Try the following:
>
> /select/?q=firstname:Kathryn&hl=on&hl.fl=firstname
>
> The reason you're seeing results with just q=students, but not
> q=synopsis:students is because you're copying the synopsis field into your
> field named 'text', which is of type 'text', which does get tokenized and
> analyzed, and 'text' is your default search field.
>
> The reason you don't see any highlights with the following query is because
> your 'text' field isn't stored.
>
> select/?q=text:students&hl=on&hl.fl=text
>
>
>
>
>
> David Snelling-2 wrote:
> >
> > Hmmm. That doesn't actually return  anything which is odd because I know
> > it's in the field if I do a query without specifying the field.
> >
> > http://qasearch.donorschoose.org/select/?q=synopsis:students
> >
> > returns nothing
> >
> > http://qasearch.donorschoose.org/select/?q=students
> >
> > returns items with query in synopsis field.
> >
> > This may be causing issues but I'm not sure why it's not working. We use
> > this live and do very complex queries including facets that work fine.
> >
> > www.donorschoose.org
> >
> >
> >
> > On Tue, Sep 23, 2008 at 2:20 PM, wojtekpia <wo...@hotmail.com> wrote:
> >
> >>
> >> Try a query where you're sure to get something to highlight in one of
> >> your
> >> highlight fields, for example:
> >>
> >>
> >>
> /select/?qt=standard&q=synopsis:crayon&hl=true&hl.fl=synopsis,shortdescription
> >>
> >>
> >>
> >> David Snelling-2 wrote:
> >> >
> >> > This is the configuration for the two fields I have tried on....
> >> >
> >> > <field name="shortdescription" type="string" indexed="true"
> >> > stored="true"/>
> >> > <field name="synopsis" type="string" indexed="true" stored="true"
> >> > compressed="true"/>
> >> >
> >> >
> >> >
> >> > On Tue, Sep 23, 2008 at 1:59 PM, wojtekpia <wo...@hotmail.com>
> >> wrote:
> >> >
> >> >>
> >> >> Make sure the fields you're trying to highlight are stored in your
> >> schema
> >> >> (e.g. <field name="synopsis" type="string" stored="true" />)
> >> >>
> >> >>
> >> >>
> >> >> David Snelling-2 wrote:
> >> >> >
> >> >> > Ok, I'm very frustrated. I've tried every configuraiton I can and
> >> >> > parameters
> >> >> > and I cannot get fragments to show up in the highlighting in solr.
> >> (no
> >> >> > fragments at the bottom or highlights <em></em> in the text. I must
> >> be
> >> >> > missing something but I'm just not sure what it is.
> >> >> >
> >> >> >
> >> >>
> >>
> /select/?qt=standard&q=crayon&hl=true&hl.fl=synopsis,shortdescription&hl.fragmenter=gap&hl.snippets=3&debugQuery=true
> >> >> >
> >> >> > And I get highlight segment, but no fragments or phrase
> >> highlighting.
> >> >> >
> >> >> > My goal - if I'm doing this completely wrong - is to get google
> like
> >> >> > snippets of text around the query term (or at mimimum to highlight
> >> the
> >> >> > query
> >> >> > term itself).
> >> >> >
> >> >> > Results:
> >> >> > <lst name="params">
> >> >> > <str name="fl">synopsis</str>
> >> >> > <str name="debugQuery">true</str>
> >> >> > <str name="hl.snippets">3</str>
> >> >> > <str name="hl.fragmenter">gap</str>
> >> >> > <str name="q">crayon</str>
> >> >> > <str name="hl.fl">synopsis</str>
> >> >> > <str name="qt">standard</str>
> >> >> > <str name="hl">true</str>
> >> >> > <str name="version">2.1</str>
> >> >> > </lst>
> >> >> > </responseHeader>
> >> >> > −
> >> >> > <result name="response" numFound="237" start="0">
> >> >> > −
> >> >> > ...........
> >> >> > .........
> >> >> > ..........
> >> >> > </result>
> >> >> > <lst name="highlighting">
> >> >> > <lst name="206738"/>
> >> >> > <lst name="184583"/>
> >> >> > <lst name="203809"/>
> >> >> > <lst name="201588"/>
> >> >> > <lst name="207554"/>
> >> >> > <lst name="157569"/>
> >> >> > <lst name="199682"/>
> >> >> > <lst name="196359"/>
> >> >> > <lst name="202940"/>
> >> >> > <lst name="190672"/>
> >> >> > </lst>
> >> >> >
> >> >> > --
> >> >> > "hic sunt dracones"
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Highlight-Fragments-tp19636705p19636915.html
> >> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > "hic sunt dracones"
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Highlight-Fragments-tp19636705p19637261.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > "hic sunt dracones"
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Highlight-Fragments-tp19636705p19637801.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
"hic sunt dracones"

Re: Highlight Fragments

Posted by wojtekpia <wo...@hotmail.com>.
Your fields are all of string type. String fields aren't tokenized or
analyzed, so you have to match the entire text of those fields to actually
get a match. Try the following:

/select/?q=firstname:Kathryn&hl=on&hl.fl=firstname

The reason you're seeing results with just q=students, but not
q=synopsis:students is because you're copying the synopsis field into your
field named 'text', which is of type 'text', which does get tokenized and
analyzed, and 'text' is your default search field.

The reason you don't see any highlights with the following query is because
your 'text' field isn't stored.

select/?q=text:students&hl=on&hl.fl=text





David Snelling-2 wrote:
> 
> Hmmm. That doesn't actually return  anything which is odd because I know
> it's in the field if I do a query without specifying the field.
> 
> http://qasearch.donorschoose.org/select/?q=synopsis:students
> 
> returns nothing
> 
> http://qasearch.donorschoose.org/select/?q=students
> 
> returns items with query in synopsis field.
> 
> This may be causing issues but I'm not sure why it's not working. We use
> this live and do very complex queries including facets that work fine.
> 
> www.donorschoose.org
> 
> 
> 
> On Tue, Sep 23, 2008 at 2:20 PM, wojtekpia <wo...@hotmail.com> wrote:
> 
>>
>> Try a query where you're sure to get something to highlight in one of
>> your
>> highlight fields, for example:
>>
>>
>> /select/?qt=standard&q=synopsis:crayon&hl=true&hl.fl=synopsis,shortdescription
>>
>>
>>
>> David Snelling-2 wrote:
>> >
>> > This is the configuration for the two fields I have tried on....
>> >
>> > <field name="shortdescription" type="string" indexed="true"
>> > stored="true"/>
>> > <field name="synopsis" type="string" indexed="true" stored="true"
>> > compressed="true"/>
>> >
>> >
>> >
>> > On Tue, Sep 23, 2008 at 1:59 PM, wojtekpia <wo...@hotmail.com>
>> wrote:
>> >
>> >>
>> >> Make sure the fields you're trying to highlight are stored in your
>> schema
>> >> (e.g. <field name="synopsis" type="string" stored="true" />)
>> >>
>> >>
>> >>
>> >> David Snelling-2 wrote:
>> >> >
>> >> > Ok, I'm very frustrated. I've tried every configuraiton I can and
>> >> > parameters
>> >> > and I cannot get fragments to show up in the highlighting in solr.
>> (no
>> >> > fragments at the bottom or highlights <em></em> in the text. I must
>> be
>> >> > missing something but I'm just not sure what it is.
>> >> >
>> >> >
>> >>
>> /select/?qt=standard&q=crayon&hl=true&hl.fl=synopsis,shortdescription&hl.fragmenter=gap&hl.snippets=3&debugQuery=true
>> >> >
>> >> > And I get highlight segment, but no fragments or phrase
>> highlighting.
>> >> >
>> >> > My goal - if I'm doing this completely wrong - is to get google like
>> >> > snippets of text around the query term (or at mimimum to highlight
>> the
>> >> > query
>> >> > term itself).
>> >> >
>> >> > Results:
>> >> > <lst name="params">
>> >> > <str name="fl">synopsis</str>
>> >> > <str name="debugQuery">true</str>
>> >> > <str name="hl.snippets">3</str>
>> >> > <str name="hl.fragmenter">gap</str>
>> >> > <str name="q">crayon</str>
>> >> > <str name="hl.fl">synopsis</str>
>> >> > <str name="qt">standard</str>
>> >> > <str name="hl">true</str>
>> >> > <str name="version">2.1</str>
>> >> > </lst>
>> >> > </responseHeader>
>> >> > −
>> >> > <result name="response" numFound="237" start="0">
>> >> > −
>> >> > ...........
>> >> > .........
>> >> > ..........
>> >> > </result>
>> >> > <lst name="highlighting">
>> >> > <lst name="206738"/>
>> >> > <lst name="184583"/>
>> >> > <lst name="203809"/>
>> >> > <lst name="201588"/>
>> >> > <lst name="207554"/>
>> >> > <lst name="157569"/>
>> >> > <lst name="199682"/>
>> >> > <lst name="196359"/>
>> >> > <lst name="202940"/>
>> >> > <lst name="190672"/>
>> >> > </lst>
>> >> >
>> >> > --
>> >> > "hic sunt dracones"
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Highlight-Fragments-tp19636705p19636915.html
>> >> Sent from the Solr - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > "hic sunt dracones"
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Highlight-Fragments-tp19636705p19637261.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> "hic sunt dracones"
> 
> 

-- 
View this message in context: http://www.nabble.com/Highlight-Fragments-tp19636705p19637801.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Highlight Fragments

Posted by David Snelling <da...@donorschoose.org>.
Hmmm. That doesn't actually return  anything which is odd because I know
it's in the field if I do a query without specifying the field.

http://qasearch.donorschoose.org/select/?q=synopsis:students

returns nothing

http://qasearch.donorschoose.org/select/?q=students

returns items with query in synopsis field.

This may be causing issues but I'm not sure why it's not working. We use
this live and do very complex queries including facets that work fine.

www.donorschoose.org



On Tue, Sep 23, 2008 at 2:20 PM, wojtekpia <wo...@hotmail.com> wrote:

>
> Try a query where you're sure to get something to highlight in one of your
> highlight fields, for example:
>
>
> /select/?qt=standard&q=synopsis:crayon&hl=true&hl.fl=synopsis,shortdescription
>
>
>
> David Snelling-2 wrote:
> >
> > This is the configuration for the two fields I have tried on....
> >
> > <field name="shortdescription" type="string" indexed="true"
> > stored="true"/>
> > <field name="synopsis" type="string" indexed="true" stored="true"
> > compressed="true"/>
> >
> >
> >
> > On Tue, Sep 23, 2008 at 1:59 PM, wojtekpia <wo...@hotmail.com> wrote:
> >
> >>
> >> Make sure the fields you're trying to highlight are stored in your
> schema
> >> (e.g. <field name="synopsis" type="string" stored="true" />)
> >>
> >>
> >>
> >> David Snelling-2 wrote:
> >> >
> >> > Ok, I'm very frustrated. I've tried every configuraiton I can and
> >> > parameters
> >> > and I cannot get fragments to show up in the highlighting in solr. (no
> >> > fragments at the bottom or highlights <em></em> in the text. I must be
> >> > missing something but I'm just not sure what it is.
> >> >
> >> >
> >>
> /select/?qt=standard&q=crayon&hl=true&hl.fl=synopsis,shortdescription&hl.fragmenter=gap&hl.snippets=3&debugQuery=true
> >> >
> >> > And I get highlight segment, but no fragments or phrase highlighting.
> >> >
> >> > My goal - if I'm doing this completely wrong - is to get google like
> >> > snippets of text around the query term (or at mimimum to highlight the
> >> > query
> >> > term itself).
> >> >
> >> > Results:
> >> > <lst name="params">
> >> > <str name="fl">synopsis</str>
> >> > <str name="debugQuery">true</str>
> >> > <str name="hl.snippets">3</str>
> >> > <str name="hl.fragmenter">gap</str>
> >> > <str name="q">crayon</str>
> >> > <str name="hl.fl">synopsis</str>
> >> > <str name="qt">standard</str>
> >> > <str name="hl">true</str>
> >> > <str name="version">2.1</str>
> >> > </lst>
> >> > </responseHeader>
> >> > −
> >> > <result name="response" numFound="237" start="0">
> >> > −
> >> > ...........
> >> > .........
> >> > ..........
> >> > </result>
> >> > <lst name="highlighting">
> >> > <lst name="206738"/>
> >> > <lst name="184583"/>
> >> > <lst name="203809"/>
> >> > <lst name="201588"/>
> >> > <lst name="207554"/>
> >> > <lst name="157569"/>
> >> > <lst name="199682"/>
> >> > <lst name="196359"/>
> >> > <lst name="202940"/>
> >> > <lst name="190672"/>
> >> > </lst>
> >> >
> >> > --
> >> > "hic sunt dracones"
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Highlight-Fragments-tp19636705p19636915.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > "hic sunt dracones"
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Highlight-Fragments-tp19636705p19637261.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
"hic sunt dracones"

Re: Highlight Fragments

Posted by wojtekpia <wo...@hotmail.com>.
Try a query where you're sure to get something to highlight in one of your
highlight fields, for example:

/select/?qt=standard&q=synopsis:crayon&hl=true&hl.fl=synopsis,shortdescription



David Snelling-2 wrote:
> 
> This is the configuration for the two fields I have tried on....
> 
> <field name="shortdescription" type="string" indexed="true"
> stored="true"/>
> <field name="synopsis" type="string" indexed="true" stored="true"
> compressed="true"/>
> 
> 
> 
> On Tue, Sep 23, 2008 at 1:59 PM, wojtekpia <wo...@hotmail.com> wrote:
> 
>>
>> Make sure the fields you're trying to highlight are stored in your schema
>> (e.g. <field name="synopsis" type="string" stored="true" />)
>>
>>
>>
>> David Snelling-2 wrote:
>> >
>> > Ok, I'm very frustrated. I've tried every configuraiton I can and
>> > parameters
>> > and I cannot get fragments to show up in the highlighting in solr. (no
>> > fragments at the bottom or highlights <em></em> in the text. I must be
>> > missing something but I'm just not sure what it is.
>> >
>> >
>> /select/?qt=standard&q=crayon&hl=true&hl.fl=synopsis,shortdescription&hl.fragmenter=gap&hl.snippets=3&debugQuery=true
>> >
>> > And I get highlight segment, but no fragments or phrase highlighting.
>> >
>> > My goal - if I'm doing this completely wrong - is to get google like
>> > snippets of text around the query term (or at mimimum to highlight the
>> > query
>> > term itself).
>> >
>> > Results:
>> > <lst name="params">
>> > <str name="fl">synopsis</str>
>> > <str name="debugQuery">true</str>
>> > <str name="hl.snippets">3</str>
>> > <str name="hl.fragmenter">gap</str>
>> > <str name="q">crayon</str>
>> > <str name="hl.fl">synopsis</str>
>> > <str name="qt">standard</str>
>> > <str name="hl">true</str>
>> > <str name="version">2.1</str>
>> > </lst>
>> > </responseHeader>
>> > −
>> > <result name="response" numFound="237" start="0">
>> > −
>> > ...........
>> > .........
>> > ..........
>> > </result>
>> > <lst name="highlighting">
>> > <lst name="206738"/>
>> > <lst name="184583"/>
>> > <lst name="203809"/>
>> > <lst name="201588"/>
>> > <lst name="207554"/>
>> > <lst name="157569"/>
>> > <lst name="199682"/>
>> > <lst name="196359"/>
>> > <lst name="202940"/>
>> > <lst name="190672"/>
>> > </lst>
>> >
>> > --
>> > "hic sunt dracones"
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Highlight-Fragments-tp19636705p19636915.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> "hic sunt dracones"
> 
> 

-- 
View this message in context: http://www.nabble.com/Highlight-Fragments-tp19636705p19637261.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Highlight Fragments

Posted by David Snelling <da...@donorschoose.org>.
This is the configuration for the two fields I have tried on....

<field name="shortdescription" type="string" indexed="true" stored="true"/>
<field name="synopsis" type="string" indexed="true" stored="true"
compressed="true"/>



On Tue, Sep 23, 2008 at 1:59 PM, wojtekpia <wo...@hotmail.com> wrote:

>
> Make sure the fields you're trying to highlight are stored in your schema
> (e.g. <field name="synopsis" type="string" stored="true" />)
>
>
>
> David Snelling-2 wrote:
> >
> > Ok, I'm very frustrated. I've tried every configuraiton I can and
> > parameters
> > and I cannot get fragments to show up in the highlighting in solr. (no
> > fragments at the bottom or highlights <em></em> in the text. I must be
> > missing something but I'm just not sure what it is.
> >
> >
> /select/?qt=standard&q=crayon&hl=true&hl.fl=synopsis,shortdescription&hl.fragmenter=gap&hl.snippets=3&debugQuery=true
> >
> > And I get highlight segment, but no fragments or phrase highlighting.
> >
> > My goal - if I'm doing this completely wrong - is to get google like
> > snippets of text around the query term (or at mimimum to highlight the
> > query
> > term itself).
> >
> > Results:
> > <lst name="params">
> > <str name="fl">synopsis</str>
> > <str name="debugQuery">true</str>
> > <str name="hl.snippets">3</str>
> > <str name="hl.fragmenter">gap</str>
> > <str name="q">crayon</str>
> > <str name="hl.fl">synopsis</str>
> > <str name="qt">standard</str>
> > <str name="hl">true</str>
> > <str name="version">2.1</str>
> > </lst>
> > </responseHeader>
> > −
> > <result name="response" numFound="237" start="0">
> > −
> > ...........
> > .........
> > ..........
> > </result>
> > <lst name="highlighting">
> > <lst name="206738"/>
> > <lst name="184583"/>
> > <lst name="203809"/>
> > <lst name="201588"/>
> > <lst name="207554"/>
> > <lst name="157569"/>
> > <lst name="199682"/>
> > <lst name="196359"/>
> > <lst name="202940"/>
> > <lst name="190672"/>
> > </lst>
> >
> > --
> > "hic sunt dracones"
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Highlight-Fragments-tp19636705p19636915.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
"hic sunt dracones"

Re: Highlight Fragments

Posted by wojtekpia <wo...@hotmail.com>.
Make sure the fields you're trying to highlight are stored in your schema
(e.g. <field name="synopsis" type="string" stored="true" />)



David Snelling-2 wrote:
> 
> Ok, I'm very frustrated. I've tried every configuraiton I can and
> parameters
> and I cannot get fragments to show up in the highlighting in solr. (no
> fragments at the bottom or highlights <em></em> in the text. I must be
> missing something but I'm just not sure what it is.
> 
> /select/?qt=standard&q=crayon&hl=true&hl.fl=synopsis,shortdescription&hl.fragmenter=gap&hl.snippets=3&debugQuery=true
> 
> And I get highlight segment, but no fragments or phrase highlighting.
> 
> My goal - if I'm doing this completely wrong - is to get google like
> snippets of text around the query term (or at mimimum to highlight the
> query
> term itself).
> 
> Results:
> <lst name="params">
> <str name="fl">synopsis</str>
> <str name="debugQuery">true</str>
> <str name="hl.snippets">3</str>
> <str name="hl.fragmenter">gap</str>
> <str name="q">crayon</str>
> <str name="hl.fl">synopsis</str>
> <str name="qt">standard</str>
> <str name="hl">true</str>
> <str name="version">2.1</str>
> </lst>
> </responseHeader>
> −
> <result name="response" numFound="237" start="0">
> −
> ...........
> .........
> ..........
> </result>
> <lst name="highlighting">
> <lst name="206738"/>
> <lst name="184583"/>
> <lst name="203809"/>
> <lst name="201588"/>
> <lst name="207554"/>
> <lst name="157569"/>
> <lst name="199682"/>
> <lst name="196359"/>
> <lst name="202940"/>
> <lst name="190672"/>
> </lst>
> 
> -- 
> "hic sunt dracones"
> 
> 

-- 
View this message in context: http://www.nabble.com/Highlight-Fragments-tp19636705p19636915.html
Sent from the Solr - User mailing list archive at Nabble.com.