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 Gintautas Sulskus <gi...@gmail.com> on 2016/11/04 11:41:54 UTC

Local parameter query and multiple fields

Hi,

If I search for "London" with the following query, I get London city at the
top.

name:London^10
category:City^5
category:Organization^1

Now I would like to store this query in SearchHandler with  a parameter
$term instead of the hard-coded word "London". However, I am not sure how
the query should be constructed to get identical results to the query
above. The following query ignores category search whatsoever:

{!qf="name^10" v=$term}
category:City^5
category:Organization^1

To add, what if I wanted to date-boost the category field (not the whole
query) if the matched $term is of type Organization?

{!qf="name^10" v=$term}
category:City^5
category:Organization^(date_boost)

Are you aware of a good book or a source on the Internet regarding query
construction as specified above?

Best,
Gintas

Re: Local parameter query and multiple fields

Posted by Gintautas Sulskus <gi...@gmail.com>.
To add: I am passing parameter defType=edismax.

On Fri, Nov 4, 2016 at 11:41 AM, Gintautas Sulskus <
gintautas.sulskus@gmail.com> wrote:

> Hi,
>
> If I search for "London" with the following query, I get London city at
> the top.
>
> name:London^10
> category:City^5
> category:Organization^1
>
> Now I would like to store this query in SearchHandler with  a parameter
> $term instead of the hard-coded word "London". However, I am not sure how
> the query should be constructed to get identical results to the query
> above. The following query ignores category search whatsoever:
>
> {!qf="name^10" v=$term}
> category:City^5
> category:Organization^1
>
> To add, what if I wanted to date-boost the category field (not the whole
> query) if the matched $term is of type Organization?
>
> {!qf="name^10" v=$term}
> category:City^5
> category:Organization^(date_boost)
>
> Are you aware of a good book or a source on the Internet regarding query
> construction as specified above?
>
> Best,
> Gintas
>