i am using solr for search and i implemented highlighting feature for my
search results. when i my search string is ring it highlight ring but when
search string is "gold ring" than also it highlight only gold, where i
wanted to highlight whole gold ring for highlighting i use description field
which i got as 
*
highlighting ={
        "8252": {
            "text": [
                " and <em>gold</em><em>Ring</em>  design was finely crafted
in Japan."
            ]
        },
        "8142": {
            "text": [
                "This <em>elegant</em> <em>Ring</em>  has an Akoya cultured
pearl with a band of bezel-set round diamonds making"
            ]
        }
    };*


Now i am parsing it as
*
$.each(newresult.response.docs, function(i,item){
   var word = highlight[item["UID_PK"]];
   var result="";
   var j=0;
   for (j=0 ;j<=item.text.length;j++)
   {
    result = result+item.text[j]+"<br>";
   }
                                result=result.replace(word,'<em>' + word +
'</em>');
});
*

Now how should i parse so that i got gold ring highlighted 


-----
Thanks & Regards
Romi
--
View this message in context: 
http://lucene.472066.n3.nabble.com/Highlight-whole-query-phrase-tp3143797p3143797.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to