Hi,

Your response says wt=json, but your solrconfig excerpt says wt=velocity.
May be you are hitting a different request handler?

What happens when you submit your query as q=Warszawa&df=text_index




On Wednesday, August 5, 2015 8:28 AM, Michał Oleś <michal.o...@gmail.com> wrote:
I installed solr 5.2.1 and use dih example with tika integration to search
for pdf content. Everything work as expected except highlighting plugin.
When I execute the query I don't even see highlighting section in results:

{
  "responseHeader": {
    "status": 0,
    "QTime": 1,
    "params": {
      "indent": "true",
      "q": "text_index:Warszawa",
      "_": "1438704448534",
      "hl.simple.pre": "<em>",
      "hl.simple.post": "</em>",
      "hl.fl": "text",
      "wt": "json",
      "hl": "true"
    }
  },
  "response": {
  "numFound": 2,
  "start": 0,
  "docs": [
  {
    "size": "698231",
    "lastModified": "Tue Aug 04 07:38:07 UTC 2015",
    "id": "C:\\Moje\\solr-5.2.1\\pdf\\D2015000105301.pdf",
    "text": [
      "\n      \n \n\nDZIENNIK USTAW \nRZECZYPOSPOLITEJ POLSKIEJ
\n\nWarszawa, dnia 29 lipca 2015 r. \n\nPoz. 1053 \n\nRO ZPORZĄDZENIE
\n\nMINISTRA OBRONY NARODOWEJ \n\nz dnia 9 lipca 2015 r. \n\n"
    ],
    "title": [
      "Pozycja 1053 DPA.555.14.2015 JS (word)"
    ],
    "author": "jswiderska"
  },
  {
    "size": "747618",
    "lastModified": "Tue Aug 04 07:37:02 UTC 2015",
    "id": "C:\\Moje\\solr-5.2.1\\pdf\\D2015000109301.pdf",
    "text": [
      "\n      \n \n\nDZIENNIK USTAW \nRZECZYPOSPOLITEJ POLSKIEJ
\n\nWarszawa, dnia 3 sierpnia 2015 r. \n\n"
    ],
    "title": [
      "OGŁ - SZCZOTKA 1093"
    ],
    "author": "bzebrowska"
  }
  ]
  }
}

My solrconfig.xml is default from that example. I tried to add default
values but it won't changed anything:

<requestHandler name="/browse" class="solr.SearchHandler">
    <lst name="defaults">
      <str name="echoParams">explicit</str>

      <!-- VelocityResponseWriter settings -->
      <str name="wt">velocity</str>
      <str name="v.template">browse</str>
      <str name="v.layout">layout</str>

      <!-- Query settings -->
      <str name="defType">edismax</str>
      <str name="q.alt">*:*</str>
      <str name="rows">10</str>
      <str name="fl">*,score</str>

      <!-- Faceting defaults -->
      <str name="facet">on</str>
      <str name="facet.mincount">1</str>

      <!-- Highlighting defaults -->
       <str name="hl">on</str>
       <str name="hl.fl">text</str>
       <str name="hl.preserveMulti">true</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.text.hl.snippets">3</str>
       <str name="f.text.hl.fragsize">200</str>
       <str name="f.text.hl.alternateField">text</str>
       <str name="f.text.hl.maxAlternateFieldLength">750</str>
    </lst>
  </requestHandler>

Here is part of schema.xml:

<field name="text" type="text_general" indexed="false" stored="true"
multiValued="true"/>
<field name="text_index" type="text_general" indexed="true"
stored="false" multiValued="true"/>
<copyField source="text" dest="text_index"/>

As in example I use two fields (one for indexing and one for store value).
When I run debug I found that highlight plugin time = 0. So it looks like
this plugin isn't even got invoked. Also in solr admin panel under tab
"Plugins/Stats" for all org.apache.solr.highlight.* classes I got 0 request.

Reply via email to