Hi Ahmet,

in my example DOC 3 also has id 2 (typo mistake). i am using edismax query
parser.

i will try the query you suggested.

Regard,
Anil







On 4 May 2016 at 12:28, Ahmet Arslan <iori...@yahoo.com> wrote:

>
>
> Hi Anil,
>
> It is weird that your query retrieves docID=2, it has not Facebook at all.
> What query parser are you using?
>
> Please try unary operators and without using quotes.
> q={!lucene} +customers:facebook -customers:google
>
> If I am not wrong above query should do the trick.
>
> But I didn't understand why you expect first document.
> If you really want to include that document too, you can capture it with
> customers:(+facebook +google) clause.
>
> Ahmet
>
>
>
> On Wednesday, May 4, 2016 8:39 AM, Anil <anilk...@gmail.com> wrote:
> Hi Ahmet,
>
> Thanks for the response. Following are sample documents.
>
> Doc 1 :
>
> id : 1
> customers : ["facebook', "google"]
> issueId:1231
> description: Some description
>
> Doc2 :
>
> id : 2
> customers : ["twitter", "google"]
> issueId:1231
> description: Some description
>
> Doc3 :
>
> id : 2
> customers : ["facebook', "amazon"]
> issueId:1233
> description: Some description
>
> Query pattern : Get documents which include facebook as customer but not
> google
> Expected documents : id = 1, 3
> Used Query : customers:"facebook" and -customers:"google"
> Actual documents : id = 2
>
> Please let me know if I have to change the query to see the expected
> documents. Thanks.
>
> Regards,
> Anil
>
>
> On 3 May 2016 at 19:44, Ahmet Arslan <iori...@yahoo.com.invalid> wrote:
>
> > Can you provide us example documents? Which you want to match which you
> > don't?
> >
> >
> >
> > On Tuesday, May 3, 2016 3:15 PM, Anil <anilk...@gmail.com> wrote:
> > Any inputs please ?
> >
> >
> > On 2 May 2016 at 18:18, Anil <anilk...@gmail.com> wrote:
> >
> > > HI,
> > >
> > > i have created a document with multi valued fields.
> > >
> > > Eg :
> > > An issue is impacting multiple customers, products, versions etc.
> > >
> > > In my issue document, i have created customers, products, versions as
> > > multi valued fields.
> > >
> > > how to find all issues that are impacting google (customer) but not
> > > facebook (customer) ?
> > >
> > > Google and facebook can be part of in single issue document.
> > >
> > > Please let me know if you have any questions. Thanks.
> > >
> > > Regards,
> > > Anil
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
>

Reply via email to