Re: How to exclude certain values in multi-value field filter query

2018-06-19 Thread Wei
Thanks Mikhail and Alessandro.

On Tue, Jun 19, 2018 at 2:37 AM, Mikhail Khludnev  wrote:

> you need to index num vals
>  apache/solr/update/processor/CountFieldValuesUpdateProcessorFactory.html>
> in the separate field, and then *:* -(V:(A AND B) AND numVals:2) -(V:(A OR
> B) AND numVals:1)
>
>
> On Tue, Jun 19, 2018 at 9:20 AM Wei  wrote:
>
> > Hi,
> >
> > I have a multi-value field,  and there is a limited set of values for the
> > field: A, B, C, D.
> > Is there a way to filter out documents that has only A or B values in the
> > multi-value field?
> >
> > Basically I want to  exclude document that has:
> >
> > A
> >
> > B
> >
> > A B
> >
> > and get documents that has:
> >
> >
> > C
> >
> > D
> >
> > C D
> >
> > A C
> >
> > B C
> >
> > A D
> >
> > B D
> >
> > A B C
> >
> > A B D
> >
> > A C D
> >
> > B C D
> >
> > A B C D
> >
> >
> > Thanks,
> >
> > Wei
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


Re: How to exclude certain values in multi-value field filter query

2018-06-19 Thread Mikhail Khludnev
you need to index num vals

in the separate field, and then *:* -(V:(A AND B) AND numVals:2) -(V:(A OR
B) AND numVals:1)


On Tue, Jun 19, 2018 at 9:20 AM Wei  wrote:

> Hi,
>
> I have a multi-value field,  and there is a limited set of values for the
> field: A, B, C, D.
> Is there a way to filter out documents that has only A or B values in the
> multi-value field?
>
> Basically I want to  exclude document that has:
>
> A
>
> B
>
> A B
>
> and get documents that has:
>
>
> C
>
> D
>
> C D
>
> A C
>
> B C
>
> A D
>
> B D
>
> A B C
>
> A B D
>
> A C D
>
> B C D
>
> A B C D
>
>
> Thanks,
>
> Wei
>


-- 
Sincerely yours
Mikhail Khludnev


Re: How to exclude certain values in multi-value field filter query

2018-06-19 Thread Alessandro Benedetti
The first idea that comes in my mind is to build a single valued copy field
which concatenates them.
in this way you will have very specific values to filter on :

query1 -(copyfield:(A B AB))

To concatenate you can use this update request processor :
https://lucene.apache.org/solr/6_6_0//solr-core/org/apache/solr/update/processor/ConcatFieldUpdateProcessorFactory.html

Regards




-
---
Alessandro Benedetti
Search Consultant, R Software Engineer, Director
Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


How to exclude certain values in multi-value field filter query

2018-06-19 Thread Wei
Hi,

I have a multi-value field,  and there is a limited set of values for the
field: A, B, C, D.
Is there a way to filter out documents that has only A or B values in the
multi-value field?

Basically I want to  exclude document that has:

A

B

A B

and get documents that has:


C

D

C D

A C

B C

A D

B D

A B C

A B D

A C D

B C D

A B C D


Thanks,

Wei