lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com>
Subject Re: boost a document which has a field not empty
Date Wed, 21 Sep 2011 13:59:38 GMT
> I have one entity called organisation. I am indexing their
> name to be able
> to search afterwards on their name.
> I store also the website of the organisation. Some
> organisations have a
> website some don't.
> Can I achieve that when searching for organisations even if
> I have a match
> on their name I will show first those which have a
> website.

Which query parser are you using? lucene? (e)dismax?

If lucene (default one), you can add an optional clause to your query:

&q=+(some query) website:[* TO *]^10 (assuming you have OR as default operator)

If dismax, there is a bq parameter which accepts lucene query syntax &bq=website:[* TO
*]^10

http://wiki.apache.org/solr/DisMaxQParserPlugin#bq_.28Boost_Query.29

Mime
View raw message