lvollmer
lvollmer

Reputation: 1618

SOLR boost query with contain syntax

in my solr call i want to boost all queries that have the word "mobile" in the longtext.

My call looks like this:

&q=*my_query*&defType=edismax&qf=xtitleLow_stringS^20++xartnumLow_stringS&ps=2&bq=xtitleLow_stringS:(*mobile*)^40

when i use the Boost query like this:

&bq=xtitleLow_stringS:"mobile"^40

it will work for fulltext but i just want to boost a query that contains it. I thought i can use the "*" contain to especially search for it. But it doesen't work, is there a mistake in my syntax?

thank you!

Upvotes: 1

Views: 84

Answers (1)

Akhilesh Kumar
Akhilesh Kumar

Reputation: 5085

The syntax of the boost query seems incorrect in my opinion. The "*" wildcard can only be used in a query when preceded by the word "text".

e.g. &bq=xtitleLow_stringS:text:mobile^40

To boost all queries that contain the word "mobile", you can write as:

&bq=xtitleLow_stringS:mobile^40

This should boost any query that contains the word "mobile" in the xtitleLow_stringS field by 40 factor.

Upvotes: 0

Related Questions