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 Alexander Aristov <al...@gmail.com> on 2012/04/02 08:05:39 UTC

default operation for a field

Hi,

Just curious if it's possible to set default operator for a field, not for
all application. I have a field and I want it always had AND operation. Is
it feasible?

Users don't enter any opeartors for this field. Only one term or several
separated by empty spaces. But if default operation is set to OR then the
field doesn't work as I expect. I need only AND. Maybe another solution is
possible?

Best Regards
Alexander Aristov

Re: default operation for a field

Posted by Alexander Aristov <al...@gmail.com>.
Ok. got it. thanks

Best Regards
Alexander Aristov


On 2 April 2012 16:37, Erick Erickson <er...@gmail.com> wrote:

> You can't set the default operator for a single field. This implies
> you're using edismax? If that's the case, your app layer can
> massage the query to something like
> term1 term2 term3 field_x:(term1 AND term2 AND term3). In which
> case field_x probably should not be in your qf parameter.
>
> Best
> Erick
>
> On Mon, Apr 2, 2012 at 2:05 AM, Alexander Aristov
> <al...@gmail.com> wrote:
> > Hi,
> >
> > Just curious if it's possible to set default operator for a field, not
> for
> > all application. I have a field and I want it always had AND operation.
> Is
> > it feasible?
> >
> > Users don't enter any opeartors for this field. Only one term or several
> > separated by empty spaces. But if default operation is set to OR then the
> > field doesn't work as I expect. I need only AND. Maybe another solution
> is
> > possible?
> >
> > Best Regards
> > Alexander Aristov
>

Re: default operation for a field

Posted by Erick Erickson <er...@gmail.com>.
You can't set the default operator for a single field. This implies
you're using edismax? If that's the case, your app layer can
massage the query to something like
term1 term2 term3 field_x:(term1 AND term2 AND term3). In which
case field_x probably should not be in your qf parameter.

Best
Erick

On Mon, Apr 2, 2012 at 2:05 AM, Alexander Aristov
<al...@gmail.com> wrote:
> Hi,
>
> Just curious if it's possible to set default operator for a field, not for
> all application. I have a field and I want it always had AND operation. Is
> it feasible?
>
> Users don't enter any opeartors for this field. Only one term or several
> separated by empty spaces. But if default operation is set to OR then the
> field doesn't work as I expect. I need only AND. Maybe another solution is
> possible?
>
> Best Regards
> Alexander Aristov