Solr newbie here
I am constructing queries to boost certain items on my webpage, and I want to be able to boost fields that contain a thumbnail (image) value:
<doc>
<str name="campaign"/>campaign
<str name="productclass">B</str>
<str name="thumbnail">
HPMAssets/d120001/derivates/1/250/103/005358625_121203_080900_9853_thumb.jpg
</str>
</doc>
For instance in the above, "thumbnail" contains a value and should therefore be displayed higher up on the search result page. I have tried:
q=(thumbnail:["" TO *])^99 (all non-empty thumbnails)
q=(-thumbnail:[* TO *])^99 (all non-null thumbnails)
q=(thumbnail:*)^99 (all thumbnails)
But it doesn't work. I know for a fact that I can boost values:
(campaign:campaign)^99
Works and will display articles with 'campaign' (that is to say, items/articles with a special offer) first on the resulting page.
Why doesn't this work for thumbnails? How do I formulate a Solr-query so that it displays articles with an existing thumbnail before articles without an existing thumbnail?
EDIT
As MatsLindh correctly pointed out,
q=(-thumbnail:[* TO *])^99
Means all documents without a thumbnail and not all non-null thumbnails, which would be:
q=(thumbnail:[* TO *]).