Highlighting not working with synonyms and phrase searching

486 views
Skip to first unread message

Alex C

unread,
Jun 3, 2013, 9:05:59 AM6/3/13
to sol...@googlegroups.com
Hi. We're having trouble with SolrNet and Solr 4.1 searching on phrases that contain words from our synonym file. We're using a non-stemming type for phrase searching. For example, if the user searches on "prologue to be invited", it won't highlight anything in the document; in this case, "prologue" is in our synonym file.

However, if we leave the "" off, it uses a field type that has stemming enabled, and it highlights each word individually in the document -- not the desired effect.

Can synonyms or phrase searching cause the highlighting to break? Any thoughts on what's going on? Thanks.

Alex C

unread,
Jun 3, 2013, 1:45:38 PM6/3/13
to sol...@googlegroups.com
By the way, here's the chunk of code for setting the highlighting; and the highlighting works via the Solr admin query:

                                       ExtraParams = new Dictionary<string, string>
                                                         {
                                                             {"df", search.DefaultField()},
                                                             {"hl.fragsize", "0"},
                                                             {"hl", "true"},
                                                             {"hl.fl", "text*"},
                                                             {"hl.useFastVectorHighlighter", "true"},
                                                             {"hl.requireFieldMatch", "true"},
                                                             {"hl.fragListBuilder", "single"},
                                                             {"hl.fragmentsBuilder", "colored"}
                                                         },

Paige Cook

unread,
Jun 3, 2013, 1:54:08 PM6/3/13
to sol...@googlegroups.com
Is this an issue with Solr or SolrNet? I am confused, b/c the behavior you describe in your original message sounds like an issue with the way that Solr is behaving, but your latest email with the statement "and the highlighting works via the Solr admin query" makes me uncertain where the problem lies. Could you please clarify?


--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alex C

unread,
Jun 3, 2013, 2:01:32 PM6/3/13
to sol...@googlegroups.com
Thanks, Paige, for your reply. That's what's interesting: Through the Solr admin, we're able to get the highlighting working. Via SolrNet, it's not working though we get the correct document. We're trying to figure out what we're missing in our SolrNet highlighting code that could cause this. It's not a Solr issue because the admin interface works fine.

So it can't be anything with the synonyms -- because it would behave the same in both places. It's with the way we're calling Solr via SolrNet.

- Alex

Paige Cook

unread,
Jun 3, 2013, 2:21:50 PM6/3/13
to sol...@googlegroups.com
Thanks for the clarification. I see that you are passing all of your Highlighting parameters using the ExtraParams settings of SolrNet. Is there are reason that you are not using the built in SolrNet Highlighting parameters?  - https://code.google.com/p/solrnet/wiki/Highlighting

From looking at the latest source code for the HighlightingParamters source - https://github.com/mausch/SolrNet/blob/master/SolrNet/Commands/Parameters/HighlightingParameters.cs it looks to support most of the Highlighting options you are specifying. I would only use the ExtraParams for the options that are not in HighlightingParameters and see if you get better results.

-Paige
Reply all
Reply to author
Forward
0 new messages