This smells like an XY problem, can you back up and give a higher-level
reason *why* you want this behavior?

Because given your problem description, this seems like you are getting
correct behavior no matter how you define the problem. You're essentially
saying that you have two records with identical beginnings of your PK,
why is it incorrect to give you both records?

But, anyway, if you're searching on FLD1 and FLD2, then by definition
you're going to get both records back or the search would be failing!

Best
Erick

On Fri, Sep 9, 2011 at 8:08 PM, Mark juszczec <mark.juszc...@gmail.com> wrote:
> Hello everyone
>
> Let's say each record in my index contains fields named PK, FLD1, FLD2, FLD3
> .... FLD100
>
> PK is my solr primary key and I'm creating it by concatenating
> FLD1+FLD2+FLD3 and I'm guaranteed that combination will be unique
>
> Let's say 2 of these records have FLD1 = A and FLD2 = B.  I am unsure about
> the remaining fields
>
> Right now, if I do a query specifying FLD1 = A and FLD2 = B then I get both
> records.  I only want 1.
>
> Research says I should use faceting.  But this:
>
> q=FLD1:A and FLD2:B & rows=500 & defType=edismax & fl=FLD1, FLD2 &
> facet=true & facet_field=FLD1 & facet_field=FLD2
>
> gives me 2 records.
>
> In fact, it gives me the same results as:
>
> q=FLD1:A and FLD2:B & rows=500 & defType=edismax & fl=FLD1, FLD2
>
> I'm wrong somewhere, but I'm unsure where.
>
> Is faceting the right way to go or should I be using grouping?
>
> Curiously, when I use grouping like this:
>
> q=FLD1:A and FLD2:B &rows=500 &defType=edismax &indent=true &fl=FLD1, FLD2
> &group=true &group.field=FLD1 &group.field=FLD2
>
> I get 2 records as well.
>
> Has anyone dealt with mimicing "select distinct" in Solr?
>
> Any advice would be very appreciated.
>
> Mark
>

Reply via email to