Thanks Jan. We were able to achieve boosting. However, when we are applying boost value for "Starts with" to keyword (For.Example: culture), solr brings the result set wherever the keyword presents but top results are contains the keyword as second word
Query: https://localhost/solr/TestIndex/select?bq=(name_t:\^culture)^10&bq=(desc_t:\^culture)^20&q=((((mediacontent_t:culture+AND+categorytype_t:Testdoc)++-)+OR+((bodycontent_t:(culture)+AND+_templatename:(%22XXX%22))++-))+AND+haslayout_b:(true))&defType=edismax&hl.simple.post=+%3C/span%3E+&hl.maxAnalyzedChars=200000&hl.fl=bodycontent_t,mediacontent_t&fl=name_t,desc_title_t,score&rows=1000 Current result: (Data security reasons - mentioned 'xxx' for project specific key words) "response":{"numFound":13788,"start":0,"maxScore":130.9114,"docs":[ { "name":"xxx Culture", "score":130.9114}, { "name":"Culture, xxx", "score":130.86884}, { "name":" xxx Culture", "score":130.68527}, { "name":" xxx Culture", "score":130.67133}, { "name":"Culture, xxx ", "score":130.25258}, { "name":"Culture, xxx ", "score":130.20874}, { "name":" xxx Culture", "score":130.17592}, { name":"Culture, xxx", "score":129.13066}, Expected result: wherever 'Culture' as first word should come at first. Any help would be highly appreciated. Thanks. -----Original Message----- From: Jan Høydahl <[email protected]> Sent: Wednesday, September 22, 2021 8:45 PM To: [email protected] Subject: Re: Priorities for fields and Phrases while indexing Caution: This email came from outside Kaiser Permanente. Do not open attachments or click on links if you do not recognize the sender. ______________________________________________________________________ Please do not cross-post to several lists. This question belongs here in the users-list only. You could yse EDismax parser to achieve different boosts per field, see the "qf" parameter in https://urldefense.com/v3/__https://solr.apache.org/guide/8_9/the-extended-dismax-query-parser.html__;!!BZ50a36bapWJ!4RDXbrNeBH3xqDT3jtfUsAr99Z4yB-J7LiYK0-FysA9TWQL7ysveHJz3mj3mU3SXHrVoLA$ If a user types "test phrase", Solr will by default require a pure phrase match. You could rewrite that query in your application to something like "test phrase" or (test phrase)^0.2 to achieve what you are after. However, users may be puzzled that they did not get the phrase they were looking for? Jan > 22. sep. 2021 kl. 14:27 skrev Thamizh Babu <[email protected]>: > > Hi, > > I am new to SOLR. We have a requirement to prioritize fields and keyword > phrases as below: > > While indexing priority as below > Title - Priority 1 > Short Desc - Priority 2 > Long Desc - Priority 3 > > If user types search phrase like “Test Phrase” > “Test Phrase” – Priority 1 > “Test” – Priority 2 > “Phrase” – Priority 3 > > Please guide us how to give priority while indexing time for above use cases. > Any help would be highly appreciated. > > Thanks, > Thamizh > > Sent from Mail > <https://urldefense.com/v3/__https://go.microsoft.com/fwlink/?LinkId=550986__;!!BZ50a36bapWJ!4RDXbrNeBH3xqDT3jtfUsAr99Z4yB-J7LiYK0-FysA9TWQL7ysveHJz3mj3mU3TY1MfWjg$ > > for Windows > > > > <https://urldefense.com/v3/__https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient__;!!BZ50a36bapWJ!4RDXbrNeBH3xqDT3jtfUsAr99Z4yB-J7LiYK0-FysA9TWQL7ysveHJz3mj3mU3TWoUnXAA$ > > Virus-free. > https://urldefense.com/v3/__http://www.avast.com__;!!BZ50a36bapWJ!4RDXbrNeBH3xqDT3jtfUsAr99Z4yB-J7LiYK0-FysA9TWQL7ysveHJz3mj3mU3R2il159A$ > > <https://urldefense.com/v3/__https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient__;!!BZ50a36bapWJ!4RDXbrNeBH3xqDT3jtfUsAr99Z4yB-J7LiYK0-FysA9TWQL7ysveHJz3mj3mU3TWoUnXAA$ > > > <x-msg://4/#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>--------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > <mailto:[email protected]> For additional commands, e-mail: > [email protected] <mailto:[email protected]> NOTICE TO RECIPIENT: If you are not the intended recipient of this e-mail, you are prohibited from sharing, copying, or otherwise using or disclosing its contents. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and permanently delete this e-mail and any attachments without reading, forwarding or saving them. v.173.295 Thank you.
