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