Multiple unique QueryOptions?

15 views
Skip to first unread message

No Jo

unread,
Jan 17, 2019, 5:22:59 AM1/17/19
to SolrNet

results = solr.Query(new SolrQueryByField("_allcontent_txt_en", "term1") && new SolrQueryByField("unionname_txt_en", "term2"), new QueryOptions

                {

                                Highlight = new HighlightingParameters

                                {

                                                Fields = new[] { "_allcontent_txt_en", "unionname_txt_en", "companyname_txt_en" },

                                                RequireFieldMatch = false

                                }

                });

 

                             

Based on the above c# snippet, both term1 and term2 highlight in all three highlight fields. But I need each SolrQueryByField to have its own QueryOptions so I can set the first SolrQueryByField to highlight term1 in all three fields but the second SolrQueryByField to highlight term2 only under the unionname_txt_en field. This requires different QueryOptions for each SolrQueryByField within the solr.Query method. Is this possible? Is there such syntax/method/solution to have more than one QueryOptions, and if so, what is the syntax as solr.Query only takes one QueryOptions parameter?

Reply all
Reply to author
Forward
0 new messages