You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Zoltan Altfatter <al...@gmail.com> on 2011/09/21 10:33:53 UTC

boost a document which has a field not empty

Hi,

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.

Thank you.

Regards,
Zoltan

Re: boost a document which has a field not empty

Posted by Alexei Martchenko <al...@superdownloads.com.br>.
Can u assign a doc boost at index time?

2011/9/21 Zoltan Altfatter <al...@gmail.com>

> Hi,
>
> 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.
>
> Thank you.
>
> Regards,
> Zoltan
>



-- 

*Alexei Martchenko* | *CEO* | Superdownloads
alexei@superdownloads.com.br | alexei@martchenko.com.br | (11)
5083.1018/5080.3535/5080.3533

Re: boost a document which has a field not empty

Posted by Zoltan Altfatter <al...@gmail.com>.
Yes, I am using edismax and the bq parameter did the trick. Thanks a lot.

On Wed, Sep 21, 2011 at 3:59 PM, Ahmet Arslan <io...@yahoo.com> wrote:

> > 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
>

Re: boost a document which has a field not empty

Posted by Ahmet Arslan <io...@yahoo.com>.
> 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