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 Fatima Issawi <is...@qu.edu.qa> on 2014/01/22 09:34:01 UTC

Highlighting not working

Hello,

I'm trying to highlight content that is returned from a Solr query, but I can't seem to get it working.

I would like to highlight the "documentname" and the "pagetext" or "content" results, but when I run the search I don't get anything returned. I thought that the "content" field is supposed to be used for hightlighting? And that [termVectors="true" termPositions="true" termOffsets="true"] needs to be added to the fields that need to be highlighted? Is there something else I'm missing?


Here is my schema:

   <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
   <field name="documentid" type="int" indexed="true" stored="true" omitNorms="true"/>
   <field name="documentname" type="text_ar" indexed="true" stored="true" termVectors="true"  termPositions="true" termOffsets="true"/>
   <field name="copyist" type="text_ar" indexed="true" stored="true"/>
  <field name="owner" type="text_ar" indexed="true" stored="true"/>
   <field name="collector" type="text_ar" indexed="true" stored="true"/>
   <field name="date" type="date" indexed="true" stored="true"/>
   <field name="pagenumber" type="int" indexed="false" stored="true"/>/>
   <field name="pagetext" type="text_ar" indexed="true" stored="false" termVectors="true" termPositions="true" termOffsets="true"/>

   <field name="content" type="text_ar" indexed="false" stored="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>

   <field name="text" type="text_ar" indexed="true" stored="false" multiValued="true"/>

   <copyField source="pagetext" dest="content" />
   <copyField source="documentname" dest="text"/>
   <copyField source="copyist" dest="text"/>
   <copyField source="owner" dest="text"/>
   <copyField source="subject" dest="text"/>
   <copyField source="date" dest="text"/>
   <copyField source="pagenumber" dest="text"/>


Thanks,
Fatima

RE: Highlighting not working

Posted by Teague James <te...@insystechinc.com>.
Vicky,

I resolved this by making sure that the field that is searched has
"stored=true". By default "text" is searched, which is the destination of
the copyFields and is not stored. If you change your copyField destination
to a field that is stored and use that field as the default search field
then highlighting should work - or at least it did for me.

As a super fast check, change the text field to "stored=true" and test.
Remember that you'll have to restart Solr and re-index first! HTH!

-Teague

-----Original Message-----
From: vicky [mailto:vicky@raytheon.com] 
Sent: Wednesday, June 18, 2014 10:28 AM
To: solr-user@lucene.apache.org
Subject: Re: Highlighting not working

Were you ever able to resolve this issue? I am having same issue and
highligh is not working for me on solr 4.8?



--
View this message in context:
http://lucene.472066.n3.nabble.com/Highlighting-not-working-tp4112659p414251
3.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Highlighting not working

Posted by vicky <vi...@raytheon.com>.
Were you ever able to resolve this issue? I am having same issue and highligh
is not working for me on solr 4.8?



--
View this message in context: http://lucene.472066.n3.nabble.com/Highlighting-not-working-tp4112659p4142513.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Highlighting not working

Posted by Ahmet Arslan <io...@yahoo.com>.
Hi Fatima,

Did you re-index after that chance? You need to re-index your documents.

Ahmet



On Thursday, January 23, 2014 7:31 AM, Fatima Issawi <is...@qu.edu.qa> wrote:
Hi,

I have stored=true for my "content" field, but I get an error saying there is a mismatch of settings on that field (I think) because of the "term*=true"  settings.

Thanks again,
Fatima




> -----Original Message-----
> From: Ahmet Arslan [mailto:iorixxx@yahoo.com]
> Sent: Wednesday, January 22, 2014 5:02 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Highlighting not working
> 
> Hi Fatima,
> 
> To enable higlighting (both standard and fastvector) you need to make
> stored="true".
> 
> Term vectors may speed up standard highlighter. Plus they are mandatory
> for FastVectorHighligher.
> 
> https://cwiki.apache.org/confluence/display/solr/Field+Properties+by+Use+
> Case
> 
> Ahmet
> 
> 
> 
> 
> 
> On Wednesday, January 22, 2014 10:44 AM, Fatima Issawi
> <is...@qu.edu.qa> wrote:
> Also my highlighting defaults...
> 
>   <requestHandler name="/browse" class="solr.SearchHandler">
>      <lst name="defaults">
> ....
>        <!-- Highlighting defaults -->
>        <str name="hl">on</str>
>        <str name="hl.fl">content documentname</str>
>        <str name="hl.encoder">html</str>
>        <str name="hl.simple.pre">&lt;b&gt;</str>
>        <str name="hl.simple.post">&lt;/b&gt;</str>
>        <str name="f.documentname.hl.fragsize">0</str>
>        <str name="f.documentname.hl.alternateField">documentname</str>
>        <str name="f.content.hl.snippets">3</str>
>        <str name="f.content.hl.fragsize">200</str>
>        <str name="f.content.hl.alternateField">content</str>
>        <str name="f.content.hl.maxAlternateFieldLength">750</str>
> 
> 
> > -----Original Message-----
> > From: Fatima Issawi [mailto:issawif@qu.edu.qa]
> > Sent: Wednesday, January 22, 2014 11:34 AM
> > To: solr-user@lucene.apache.org
> > Subject: Highlighting not working
> >
> > Hello,
> >
> > I'm trying to highlight content that is returned from a Solr query,
> > but I can't seem to get it working.
> >
> > I would like to highlight the "documentname" and the "pagetext" or
> > "content" results, but when I run the search I don't get anything
> > returned. I thought that the "content" field is supposed to be used for
> hightlighting?
> > And that [termVectors="true" termPositions="true" termOffsets="true"]
> > needs to be added to the fields that need to be highlighted? Is there
> > something else I'm missing?
> >
> >
> > Here is my schema:
> >
> >    <field name="id" type="string" indexed="true" stored="true"
> > required="true" multiValued="false" />
> >    <field name="documentid" type="int" indexed="true" stored="true"
> > omitNorms="true"/>
> >    <field name="documentname" type="text_ar" indexed="true"
> > stored="true" termVectors="true"  termPositions="true"
> > termOffsets="true"/>
> >    <field name="copyist" type="text_ar" indexed="true" stored="true"/>
> >   <field name="owner" type="text_ar" indexed="true" stored="true"/>
> >    <field name="collector" type="text_ar" indexed="true"
> >stored="true"/>
> >    <field name="date" type="date" indexed="true" stored="true"/>
> >    <field name="pagenumber" type="int" indexed="false"
> >stored="true"/>/>
> >    <field name="pagetext" type="text_ar" indexed="true" stored="false"
> > termVectors="true" termPositions="true" termOffsets="true"/>
> >
> >    <field name="content" type="text_ar" indexed="false" stored="true"
> > multiValued="true" termVectors="true" termPositions="true"
> > termOffsets="true"/>
> >
> >    <field name="text" type="text_ar" indexed="true" stored="false"
> > multiValued="true"/>
> >
> >    <copyField source="pagetext" dest="content" />
> >    <copyField source="documentname" dest="text"/>
> >    <copyField source="copyist" dest="text"/>
> >    <copyField source="owner" dest="text"/>
> >    <copyField source="subject" dest="text"/>
> >    <copyField source="date" dest="text"/>
> >    <copyField source="pagenumber" dest="text"/>
> >
> >
> > Thanks,
> > Fatima

RE: Highlighting not working

Posted by Fatima Issawi <is...@qu.edu.qa>.
Hi,

I have stored=true for my "content" field, but I get an error saying there is a mismatch of settings on that field (I think) because of the "term*=true"  settings.

Thanks again,
Fatima



> -----Original Message-----
> From: Ahmet Arslan [mailto:iorixxx@yahoo.com]
> Sent: Wednesday, January 22, 2014 5:02 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Highlighting not working
> 
> Hi Fatima,
> 
> To enable higlighting (both standard and fastvector) you need to make
> stored="true".
> 
> Term vectors may speed up standard highlighter. Plus they are mandatory
> for FastVectorHighligher.
> 
> https://cwiki.apache.org/confluence/display/solr/Field+Properties+by+Use+
> Case
> 
> Ahmet
> 
> 
> 
> 
> 
> On Wednesday, January 22, 2014 10:44 AM, Fatima Issawi
> <is...@qu.edu.qa> wrote:
> Also my highlighting defaults...
> 
>   <requestHandler name="/browse" class="solr.SearchHandler">
>      <lst name="defaults">
> ....
>        <!-- Highlighting defaults -->
>        <str name="hl">on</str>
>        <str name="hl.fl">content documentname</str>
>        <str name="hl.encoder">html</str>
>        <str name="hl.simple.pre">&lt;b&gt;</str>
>        <str name="hl.simple.post">&lt;/b&gt;</str>
>        <str name="f.documentname.hl.fragsize">0</str>
>        <str name="f.documentname.hl.alternateField">documentname</str>
>        <str name="f.content.hl.snippets">3</str>
>        <str name="f.content.hl.fragsize">200</str>
>        <str name="f.content.hl.alternateField">content</str>
>        <str name="f.content.hl.maxAlternateFieldLength">750</str>
> 
> 
> > -----Original Message-----
> > From: Fatima Issawi [mailto:issawif@qu.edu.qa]
> > Sent: Wednesday, January 22, 2014 11:34 AM
> > To: solr-user@lucene.apache.org
> > Subject: Highlighting not working
> >
> > Hello,
> >
> > I'm trying to highlight content that is returned from a Solr query,
> > but I can't seem to get it working.
> >
> > I would like to highlight the "documentname" and the "pagetext" or
> > "content" results, but when I run the search I don't get anything
> > returned. I thought that the "content" field is supposed to be used for
> hightlighting?
> > And that [termVectors="true" termPositions="true" termOffsets="true"]
> > needs to be added to the fields that need to be highlighted? Is there
> > something else I'm missing?
> >
> >
> > Here is my schema:
> >
> >    <field name="id" type="string" indexed="true" stored="true"
> > required="true" multiValued="false" />
> >    <field name="documentid" type="int" indexed="true" stored="true"
> > omitNorms="true"/>
> >    <field name="documentname" type="text_ar" indexed="true"
> > stored="true" termVectors="true"  termPositions="true"
> > termOffsets="true"/>
> >    <field name="copyist" type="text_ar" indexed="true" stored="true"/>
> >   <field name="owner" type="text_ar" indexed="true" stored="true"/>
> >    <field name="collector" type="text_ar" indexed="true"
> >stored="true"/>
> >    <field name="date" type="date" indexed="true" stored="true"/>
> >    <field name="pagenumber" type="int" indexed="false"
> >stored="true"/>/>
> >    <field name="pagetext" type="text_ar" indexed="true" stored="false"
> > termVectors="true" termPositions="true" termOffsets="true"/>
> >
> >    <field name="content" type="text_ar" indexed="false" stored="true"
> > multiValued="true" termVectors="true" termPositions="true"
> > termOffsets="true"/>
> >
> >    <field name="text" type="text_ar" indexed="true" stored="false"
> > multiValued="true"/>
> >
> >    <copyField source="pagetext" dest="content" />
> >    <copyField source="documentname" dest="text"/>
> >    <copyField source="copyist" dest="text"/>
> >    <copyField source="owner" dest="text"/>
> >    <copyField source="subject" dest="text"/>
> >    <copyField source="date" dest="text"/>
> >    <copyField source="pagenumber" dest="text"/>
> >
> >
> > Thanks,
> > Fatima

Re: Highlighting not working

Posted by Ahmet Arslan <io...@yahoo.com>.
Hi Fatima,

To enable higlighting (both standard and fastvector) you need to make stored="true". 

Term vectors may speed up standard highlighter. Plus they are mandatory for FastVectorHighligher.

https://cwiki.apache.org/confluence/display/solr/Field+Properties+by+Use+Case

Ahmet





On Wednesday, January 22, 2014 10:44 AM, Fatima Issawi <is...@qu.edu.qa> wrote:
Also my highlighting defaults...

  <requestHandler name="/browse" class="solr.SearchHandler">
     <lst name="defaults">
....
       <!-- Highlighting defaults -->
       <str name="hl">on</str>
       <str name="hl.fl">content documentname</str>
       <str name="hl.encoder">html</str>
       <str name="hl.simple.pre">&lt;b&gt;</str>
       <str name="hl.simple.post">&lt;/b&gt;</str>
       <str name="f.documentname.hl.fragsize">0</str>
       <str name="f.documentname.hl.alternateField">documentname</str>
       <str name="f.content.hl.snippets">3</str>
       <str name="f.content.hl.fragsize">200</str>
       <str name="f.content.hl.alternateField">content</str>
       <str name="f.content.hl.maxAlternateFieldLength">750</str>


> -----Original Message-----
> From: Fatima Issawi [mailto:issawif@qu.edu.qa]
> Sent: Wednesday, January 22, 2014 11:34 AM
> To: solr-user@lucene.apache.org
> Subject: Highlighting not working
> 
> Hello,
> 
> I'm trying to highlight content that is returned from a Solr query, but I can't
> seem to get it working.
> 
> I would like to highlight the "documentname" and the "pagetext" or
> "content" results, but when I run the search I don't get anything returned. I
> thought that the "content" field is supposed to be used for hightlighting?
> And that [termVectors="true" termPositions="true" termOffsets="true"]
> needs to be added to the fields that need to be highlighted? Is there
> something else I'm missing?
> 
> 
> Here is my schema:
> 
>    <field name="id" type="string" indexed="true" stored="true"
> required="true" multiValued="false" />
>    <field name="documentid" type="int" indexed="true" stored="true"
> omitNorms="true"/>
>    <field name="documentname" type="text_ar" indexed="true"
> stored="true" termVectors="true"  termPositions="true"
> termOffsets="true"/>
>    <field name="copyist" type="text_ar" indexed="true" stored="true"/>
>   <field name="owner" type="text_ar" indexed="true" stored="true"/>
>    <field name="collector" type="text_ar" indexed="true" stored="true"/>
>    <field name="date" type="date" indexed="true" stored="true"/>
>    <field name="pagenumber" type="int" indexed="false" stored="true"/>/>
>    <field name="pagetext" type="text_ar" indexed="true" stored="false"
> termVectors="true" termPositions="true" termOffsets="true"/>
> 
>    <field name="content" type="text_ar" indexed="false" stored="true"
> multiValued="true" termVectors="true" termPositions="true"
> termOffsets="true"/>
> 
>    <field name="text" type="text_ar" indexed="true" stored="false"
> multiValued="true"/>
> 
>    <copyField source="pagetext" dest="content" />
>    <copyField source="documentname" dest="text"/>
>    <copyField source="copyist" dest="text"/>
>    <copyField source="owner" dest="text"/>
>    <copyField source="subject" dest="text"/>
>    <copyField source="date" dest="text"/>
>    <copyField source="pagenumber" dest="text"/>
> 
> 
> Thanks,
> Fatima

RE: Highlighting not working

Posted by Fatima Issawi <is...@qu.edu.qa>.
Also my highlighting defaults...

  <requestHandler name="/browse" class="solr.SearchHandler">
     <lst name="defaults">
....
       <!-- Highlighting defaults -->
       <str name="hl">on</str>
       <str name="hl.fl">content documentname</str>
       <str name="hl.encoder">html</str>
       <str name="hl.simple.pre">&lt;b&gt;</str>
       <str name="hl.simple.post">&lt;/b&gt;</str>
       <str name="f.documentname.hl.fragsize">0</str>
       <str name="f.documentname.hl.alternateField">documentname</str>
       <str name="f.content.hl.snippets">3</str>
       <str name="f.content.hl.fragsize">200</str>
       <str name="f.content.hl.alternateField">content</str>
       <str name="f.content.hl.maxAlternateFieldLength">750</str>

> -----Original Message-----
> From: Fatima Issawi [mailto:issawif@qu.edu.qa]
> Sent: Wednesday, January 22, 2014 11:34 AM
> To: solr-user@lucene.apache.org
> Subject: Highlighting not working
> 
> Hello,
> 
> I'm trying to highlight content that is returned from a Solr query, but I can't
> seem to get it working.
> 
> I would like to highlight the "documentname" and the "pagetext" or
> "content" results, but when I run the search I don't get anything returned. I
> thought that the "content" field is supposed to be used for hightlighting?
> And that [termVectors="true" termPositions="true" termOffsets="true"]
> needs to be added to the fields that need to be highlighted? Is there
> something else I'm missing?
> 
> 
> Here is my schema:
> 
>    <field name="id" type="string" indexed="true" stored="true"
> required="true" multiValued="false" />
>    <field name="documentid" type="int" indexed="true" stored="true"
> omitNorms="true"/>
>    <field name="documentname" type="text_ar" indexed="true"
> stored="true" termVectors="true"  termPositions="true"
> termOffsets="true"/>
>    <field name="copyist" type="text_ar" indexed="true" stored="true"/>
>   <field name="owner" type="text_ar" indexed="true" stored="true"/>
>    <field name="collector" type="text_ar" indexed="true" stored="true"/>
>    <field name="date" type="date" indexed="true" stored="true"/>
>    <field name="pagenumber" type="int" indexed="false" stored="true"/>/>
>    <field name="pagetext" type="text_ar" indexed="true" stored="false"
> termVectors="true" termPositions="true" termOffsets="true"/>
> 
>    <field name="content" type="text_ar" indexed="false" stored="true"
> multiValued="true" termVectors="true" termPositions="true"
> termOffsets="true"/>
> 
>    <field name="text" type="text_ar" indexed="true" stored="false"
> multiValued="true"/>
> 
>    <copyField source="pagetext" dest="content" />
>    <copyField source="documentname" dest="text"/>
>    <copyField source="copyist" dest="text"/>
>    <copyField source="owner" dest="text"/>
>    <copyField source="subject" dest="text"/>
>    <copyField source="date" dest="text"/>
>    <copyField source="pagenumber" dest="text"/>
> 
> 
> Thanks,
> Fatima