IM using SolrNet (Version: 0.4.0.2002)to Query and my class is My class is:
public class SolrSimpleArticle
{
[SolrUniqueKey("articleid")]
public string ArticleId { get; set; }
[SolrField("bodytext")]
public string BodyText { get; set; }
}My problem is that I can't make highlights to work. My code for highlightning:
var results = solr.Query(iql, new QueryOptions
{
Start = start,
Rows = 20,
Highlight = new HighlightingParameters
{
Fields = new[] { "bodytext" },
AfterTerm = highlight,
Snippets = 20,
MaxAnalyzedChars = 100000,
}
});The returned results is as follows:
highlightedtext: Object
e410a0ac: Array[1]
0: Object
Key: "bodytext"
Value: Array[0]
__proto__: Object
length: 1
__proto__: Array[0]
e410b729: Array[1]
0: Object
Key: "bodytext"
Value: Array[0]
length: 0
__proto__: Array[0]
__proto__: Object
length: 1
__proto__: Array[0]I need to know how i can get the highlighted snippet for each result and why there is no elements in the value array?Am I doing something wrong here?
I tried the defaults mentioned inhttps://github.com/mausch/SolrNet/blob/master/Documentation/Highlighting.md Same response though.
--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrnet+u...@googlegroups.com.
To post to this group, send email to sol...@googlegroups.com.
Visit this group at http://groups.google.com/group/solrnet.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrnet+u...@googlegroups.com.
To post to this group, send email to sol...@googlegroups.com.
Visit this group at http://groups.google.com/group/solrnet.
For more options, visit https://groups.google.com/d/optout.
Hi Mauricio, Thanks for a quick fix,
There a still two small issue remaining with regard to highlights,
1) Solr highlights returns empty value when used with multiple fields
var results = solr.Query(iql, new QueryOptions
{
Start = start,
Rows = 20,
Highlight = new HighlightingParameters
{
Fields = new[] { "bodytext", "allheadings" },
BeforeTerm = "<highlight>",
AfterTerm = "</highlight>"
},
});
On checking with the logging connection, I find the parameters as follows’
GETting: q=hund, start=0, rows=20, hl=true, hl.fl=bodytext,allheadings, hl.simple.pre=<highlight>, hl.simple.post=</highlight> from/select
Correct me if im wrong, I guess separate highlights should be issued for each field? Eg(hl.fl=bodytext hl.fl=allheadings)
2) Solr highlights does not include a BeforeTerm = "<highlight>",AfterTerm = "</highlight>" value when used without defining fields to be highlighted, The idea here is to return all the fields with highlights. On inspection, I do find the highlights wrapped with "<em>","</em>" tags.
var results = solr.Query(iql, new QueryOptions
{
Start = start,
Rows = 20,
Highlight = new HighlightingParameters
{
BeforeTerm = "<highlight>",
AfterTerm = "</highlight>"
},
});
On checking with the logging connection, I find the parameters as follows’, which misses a BeforeTerm = "<highlight>",AfterTerm = "</highlight>"
GETting/POSTing: q=hund, start=0, rows=20, hl=true from/select
--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrnet+u...@googlegroups.com.
To post to this group, send email to sol...@googlegroups.com.
Visit this group at http://groups.google.com/group/solrnet.