lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xavier Schepler <xavier.schep...@sciences-po.fr>
Subject Need help with highlighting (detailed problem with code samples)
Date Thu, 14 Jan 2010 16:32:03 GMT
Hey,

I have highlighting working with this field :

<field     name="questionsLabelsFr"
            required="false"
            type="textFr"
            multiValued="true"
            indexed="true"
            stored="true"
            compressed="false"
            omitNorms="false"
            termVectors="true"
            termPositions="true"
            termOffsets="true"
    />

when I query the solr server this way :  
/select/?q=election&version=2.2&start=0&rows=10&indent=on&hl=on&hl.fl=questionsLabelsFr&hl.fragsize=0

I got results like this :

<lst name="highlighting">
<lst name="0ad4d4fe-cff8-43c8-b5d2-cf86c71b044c">
<arr name="questionsLabelsFr">
<str>
Au second tour des <em>élections</em> législatives dimanche prochain, 
avez-vous l'intention d'aller voter?
</str>
</arr>
</lst>
....

That's the expected result and I'm pretty happy with it.

But with this field :

<field     name="variableEltDDIXML"
            required="true"
            type="string"
            multiValued="false"
            indexed="true"
            stored="true"
            compressed="false"
            omitNorms="false"
            termVectors="false"
            termPositions="false"
            termOffsets="false"
    />

when I query the solr server this way : 
/select/?q=election&version=2.2&start=0&rows=10&indent=on&hl=on&hl.fl=variableEltDDIXML&hl.fragsize=0

I got results like this :

<lst name="highlighting">
<lst name="0ad4d4fe-cff8-43c8-b5d2-cf86c71b044c"/>
...

with self closing lst tags, whereas I want the whole contents from the 
field with highlighted matches.

The field named variableEltDDIXML contains all the contents from the 
other fields but in XML format :

<var ID="V18" name="q11a1" files="F1" dcml="0" intrvl="discrete">
      <location width="1"/>
      <labl>
        Ira voter au second tour des élections législatives
      </labl>
      <qstn>
        <qstnLit>
          Au second tour des élections législatives dimanche prochain, 
avez-vous l'intention d'aller voter?
        </qstnLit>
        <postQTxt>
          <![CDATA[si réponse "oui" poser la question 11a2
si autres réponses passer à la question 13]]>
        </postQTxt>
      </qstn>
      <valrng>
        <range UNITS="REAL" min="1" max="2"/>
      </valrng>
      <invalrng>
        <item UNITS="REAL" VALUE="8"/>
        <item UNITS="REAL" VALUE="9"/>
      </invalrng>
      <sumStat type="vald">
        2962
      </sumStat>
      <sumStat type="invd">
        48
      </sumStat>
      <catgry>
        <catValu>
          1
        </catValu>
        <labl>
          Oui
        </labl>
        <catStat type="freq">
          2747
        </catStat>
      </catgry>
      <catgry>
        <catValu>
          2
        </catValu>
        <labl>
          Non
        </labl>
        <catStat type="freq">
          215
        </catStat>
      </catgry>
      <catgry missing="Y">
        <catValu>
          8
        </catValu>
        <catStat type="freq">
          30
        </catStat>
      </catgry>
      <catgry missing="Y">
        <catValu>
          9
        </catValu>
        <labl>
          Non réponse
        </labl>
        <catStat type="freq">
          18
        </catStat>
      </catgry>
      <varFormat type="numeric" schema="other"/>
    </var>

Why are the "lst" tags from the "lst highlighting" list self closing 
when matches are found in variableEltDDIXML contents ?

Thanks in advance,

Xavier



Mime
View raw message