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 Frank Chiu <fr...@gmail.com> on 2011/07/30 10:07:12 UTC

fragsize for highlighting

Hi, I'm setting hl.fragsize = 10 in all my highlighting fragmenters but I'm
still getting snippets being returned with > 10 characters (I think I'm
getting the full text back).  I also tried specifying hl.fragsize in the
querystring, but the same thing happens.  Any idea why fragsize is not
getting picked up?
Thanks!

Re: fragsize for highlighting

Posted by Frank Chiu <fr...@gmail.com>.
I ended up removing the EdgeNGramFilterFactory and the highlighting seems to
work okay.  Thanks for your help, echoParams is useful.

On Sat, Jul 30, 2011 at 2:07 PM, Ahmet Arslan <io...@yahoo.com> wrote:

>
> I suspected that you set fragsize twice, but from what you paste thats not
> the case.  e.g. f.description_texts.hl.fragsize=100&hl.fragsize=10
>
> However the response you pasted is not coming from that URL. It will be
> better to see compatible URL and response.
>
> echoParams=all displays all parameters used. Both defaults defined in
> solrconfig.xml and the ones in URL.
>
> http://wiki.apache.org/solr/CoreQueryParameters#echoParams
>
>
> --- On Sat, 7/30/11, Frank Chiu <fr...@gmail.com> wrote:
>
> > From: Frank Chiu <fr...@gmail.com>
> > Subject: Re: fragsize for highlighting
> > To: "Ahmet Arslan" <io...@yahoo.com>
> > Cc: solr-user@lucene.apache.org
> > Date: Saturday, July 30, 2011, 9:35 PM
> > I'm a bit of a newbie- adding
> > echoParams=all to my querystring isn't
> > yielding additional info (does solr 1.4 support it?).
> > Here's a query (also
> > tried adding hl.fragsize=10):
> >
> >
> http://localhost:8982/solr/select/?fl=*+score&start=0&q=gofish&qf=description_texts&hl.simple.pre=@@@hl@@@&hl.simple.post=@@@endhl@@@&fq=type:(Task)&hl=on&defType=dismax&rows=30&echoParams=all<http://localhost:8982/solr/select/?fl=*+score&start=0&q=gofish&qf=description_texts&hl.simple.pre=@@@hl@@@&hl.simple.post=@@@endhl@@@&fq=type:%28Task%29&hl=on&defType=dismax&rows=30&echoParams=all>
> >
> > <response>
> > <lst name="responseHeader">
> > <int name="status">0</int>
> > <int name="QTime">3</int>
> > <lst name="params">
> > <str name="hl.fragsize">10</str>
> > <str name="fl">* score</str>
> > <str name="start">0</str>
> > <str name="q">immanu</str>
> > <str name="qf">description_texts</str>
> > <str name="hl.simple.pre">@@@hl@@@</str>
> > <str name="hl.simple.post">@@@endhl@@@</str>
> > <str name="fq">type:(Task)</str>
> > <str name="hl">on</str>
> > <str name="defType">dismax</str>
> > <str name="rows">30</str>
> > </lst>
> > </lst>
> >
> > <lst name="highlighting">
> > ...
> > <str>
> > @@@hl@@@some s@@@endhl@@@uper long piece of text. long
> > interesting stuff and
> > text gofish found
> > </str>
> > </arr>
> > ...
> > </response>
> >
> >
> >
> >
> >
> > On Sat, Jul 30, 2011 at 2:58 AM, Ahmet Arslan <io...@yahoo.com>
> > wrote:
> >
> > > > Hi, I'm setting hl.fragsize = 10 in
> > > > all my highlighting fragmenters but I'm
> > > > still getting snippets being returned with >
> > 10
> > > > characters (I think I'm
> > > > getting the full text back).  I also tried
> > specifying
> > > > hl.fragsize in the
> > > > querystring, but the same thing happens.
> > Any idea why
> > > > fragsize is not
> > > > getting picked up?
> > >
> > > May be you are setting it twice? What is the output of
> > &echoParams=all?
> > >
> >
>

Re: fragsize for highlighting

Posted by Ahmet Arslan <io...@yahoo.com>.
I suspected that you set fragsize twice, but from what you paste thats not the case.  e.g. f.description_texts.hl.fragsize=100&hl.fragsize=10

However the response you pasted is not coming from that URL. It will be better to see compatible URL and response.

echoParams=all displays all parameters used. Both defaults defined in solrconfig.xml and the ones in URL.

http://wiki.apache.org/solr/CoreQueryParameters#echoParams


--- On Sat, 7/30/11, Frank Chiu <fr...@gmail.com> wrote:

> From: Frank Chiu <fr...@gmail.com>
> Subject: Re: fragsize for highlighting
> To: "Ahmet Arslan" <io...@yahoo.com>
> Cc: solr-user@lucene.apache.org
> Date: Saturday, July 30, 2011, 9:35 PM
> I'm a bit of a newbie- adding
> echoParams=all to my querystring isn't
> yielding additional info (does solr 1.4 support it?). 
> Here's a query (also
> tried adding hl.fragsize=10):
> 
> http://localhost:8982/solr/select/?fl=*+score&start=0&q=gofish&qf=description_texts&hl.simple.pre=@@@hl@@@&hl.simple.post=@@@endhl@@@&fq=type:(Task)&hl=on&defType=dismax&rows=30&echoParams=all
> 
> <response>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">3</int>
> <lst name="params">
> <str name="hl.fragsize">10</str>
> <str name="fl">* score</str>
> <str name="start">0</str>
> <str name="q">immanu</str>
> <str name="qf">description_texts</str>
> <str name="hl.simple.pre">@@@hl@@@</str>
> <str name="hl.simple.post">@@@endhl@@@</str>
> <str name="fq">type:(Task)</str>
> <str name="hl">on</str>
> <str name="defType">dismax</str>
> <str name="rows">30</str>
> </lst>
> </lst>
> 
> <lst name="highlighting">
> ...
> <str>
> @@@hl@@@some s@@@endhl@@@uper long piece of text. long
> interesting stuff and
> text gofish found
> </str>
> </arr>
> ...
> </response>
> 
> 
> 
> 
> 
> On Sat, Jul 30, 2011 at 2:58 AM, Ahmet Arslan <io...@yahoo.com>
> wrote:
> 
> > > Hi, I'm setting hl.fragsize = 10 in
> > > all my highlighting fragmenters but I'm
> > > still getting snippets being returned with >
> 10
> > > characters (I think I'm
> > > getting the full text back).  I also tried
> specifying
> > > hl.fragsize in the
> > > querystring, but the same thing happens. 
> Any idea why
> > > fragsize is not
> > > getting picked up?
> >
> > May be you are setting it twice? What is the output of
> &echoParams=all?
> >
> 

Re: fragsize for highlighting

Posted by Frank Chiu <fr...@gmail.com>.
I'm a bit of a newbie- adding echoParams=all to my querystring isn't
yielding additional info (does solr 1.4 support it?).  Here's a query (also
tried adding hl.fragsize=10):

http://localhost:8982/solr/select/?fl=*+score&start=0&q=gofish&qf=description_texts&hl.simple.pre=@@@hl@@@&hl.simple.post=@@@endhl@@@&fq=type:(Task)&hl=on&defType=dismax&rows=30&echoParams=all

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">3</int>
<lst name="params">
<str name="hl.fragsize">10</str>
<str name="fl">* score</str>
<str name="start">0</str>
<str name="q">immanu</str>
<str name="qf">description_texts</str>
<str name="hl.simple.pre">@@@hl@@@</str>
<str name="hl.simple.post">@@@endhl@@@</str>
<str name="fq">type:(Task)</str>
<str name="hl">on</str>
<str name="defType">dismax</str>
<str name="rows">30</str>
</lst>
</lst>

<lst name="highlighting">
...
<str>
@@@hl@@@some s@@@endhl@@@uper long piece of text. long interesting stuff and
text gofish found
</str>
</arr>
...
</response>





On Sat, Jul 30, 2011 at 2:58 AM, Ahmet Arslan <io...@yahoo.com> wrote:

> > Hi, I'm setting hl.fragsize = 10 in
> > all my highlighting fragmenters but I'm
> > still getting snippets being returned with > 10
> > characters (I think I'm
> > getting the full text back).  I also tried specifying
> > hl.fragsize in the
> > querystring, but the same thing happens.  Any idea why
> > fragsize is not
> > getting picked up?
>
> May be you are setting it twice? What is the output of &echoParams=all?
>

Re: fragsize for highlighting

Posted by Ahmet Arslan <io...@yahoo.com>.
> Hi, I'm setting hl.fragsize = 10 in
> all my highlighting fragmenters but I'm
> still getting snippets being returned with > 10
> characters (I think I'm
> getting the full text back).  I also tried specifying
> hl.fragsize in the
> querystring, but the same thing happens.  Any idea why
> fragsize is not
> getting picked up?

May be you are setting it twice? What is the output of &echoParams=all?