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 Aaron Bains <aa...@gmail.com> on 2011/08/29 23:52:48 UTC

Solr Faceting & DIH

Hello,

I am trying to setup Solr Faceting on products by using the
DataImportHandler to import data from my database. I have setup my
data-config.xml with the proper queries and schema.xml with the fields.
After the import/index is complete I can only search one productid record in
Solr. For example of the three productid '10100039' records there are I am
only able to search for one of those. Should I somehow disable unique ids?
What is the best way of doing this?

Below is the schema I am trying to index:

+-----------+-------------+---------+------------+
| productid | attributeid | valueid | categoryid |
+-----------+-------------+---------+------------+
|  10100039 |      331100 |    1580 |      10000 |
|  10100039 |      331694 |    1581 |      10000 |
|  10100039 |    33113319 | 1537370 |      10000 |
|  10100040 |      331100 |    1580 |      10000 |
|  10100040 |      331694 | 1540230 |      10000 |
|  10100040 |    33113319 | 1537370 |      10000 |
+-----------+-------------+---------+------------+

Thanks!

Re: Solr Faceting & DIH

Posted by Way Cool <wa...@gmail.com>.
I think you need to setup entity hierarchy with product as a top level
entity and attribute as another entity under product, otherwise the record
#2 and 3 will override the first one.

On Mon, Aug 29, 2011 at 3:52 PM, Aaron Bains <aa...@gmail.com> wrote:

> Hello,
>
> I am trying to setup Solr Faceting on products by using the
> DataImportHandler to import data from my database. I have setup my
> data-config.xml with the proper queries and schema.xml with the fields.
> After the import/index is complete I can only search one productid record
> in
> Solr. For example of the three productid '10100039' records there are I am
> only able to search for one of those. Should I somehow disable unique ids?
> What is the best way of doing this?
>
> Below is the schema I am trying to index:
>
> +-----------+-------------+---------+------------+
> | productid | attributeid | valueid | categoryid |
> +-----------+-------------+---------+------------+
> |  10100039 |      331100 |    1580 |      10000 |
> |  10100039 |      331694 |    1581 |      10000 |
> |  10100039 |    33113319 | 1537370 |      10000 |
> |  10100040 |      331100 |    1580 |      10000 |
> |  10100040 |      331694 | 1540230 |      10000 |
> |  10100040 |    33113319 | 1537370 |      10000 |
> +-----------+-------------+---------+------------+
>
> Thanks!
>

Re: Solr Faceting & DIH

Posted by Alexei Martchenko <al...@superdownloads.com.br>.
I had the same problem with a database here, and we discovered that every
item had its own product page, its own url. So, we decided that our unique
id had to be the url instead of using sql ids and id concatenations.
sometimes it works. You can store all ids if u need them for something, but
for uniqueids, urls go just fine.

2011/8/30 Erick Erickson <er...@gmail.com>

> I'd really think carefully before disabling unique IDs. If you do,
> you'll have to manage the records yourself, so your next
> delta-import will add more records to your search result, even
> those that have been updated.
>
> You might do something like make the uniqueKey the
> concatenation of productid and attributeid or whatever
> makes sense.
>
> Best
> Erick
>
> On Mon, Aug 29, 2011 at 5:52 PM, Aaron Bains <aa...@gmail.com> wrote:
> > Hello,
> >
> > I am trying to setup Solr Faceting on products by using the
> > DataImportHandler to import data from my database. I have setup my
> > data-config.xml with the proper queries and schema.xml with the fields.
> > After the import/index is complete I can only search one productid record
> in
> > Solr. For example of the three productid '10100039' records there are I
> am
> > only able to search for one of those. Should I somehow disable unique
> ids?
> > What is the best way of doing this?
> >
> > Below is the schema I am trying to index:
> >
> > +-----------+-------------+---------+------------+
> > | productid | attributeid | valueid | categoryid |
> > +-----------+-------------+---------+------------+
> > |  10100039 |      331100 |    1580 |      10000 |
> > |  10100039 |      331694 |    1581 |      10000 |
> > |  10100039 |    33113319 | 1537370 |      10000 |
> > |  10100040 |      331100 |    1580 |      10000 |
> > |  10100040 |      331694 | 1540230 |      10000 |
> > |  10100040 |    33113319 | 1537370 |      10000 |
> > +-----------+-------------+---------+------------+
> >
> > Thanks!
> >
>



-- 

*Alexei Martchenko* | *CEO* | Superdownloads
alexei@superdownloads.com.br | alexei@martchenko.com.br | (11)
5083.1018/5080.3535/5080.3533

Re: Solr Faceting & DIH

Posted by Erick Erickson <er...@gmail.com>.
I'd really think carefully before disabling unique IDs. If you do,
you'll have to manage the records yourself, so your next
delta-import will add more records to your search result, even
those that have been updated.

You might do something like make the uniqueKey the
concatenation of productid and attributeid or whatever
makes sense.

Best
Erick

On Mon, Aug 29, 2011 at 5:52 PM, Aaron Bains <aa...@gmail.com> wrote:
> Hello,
>
> I am trying to setup Solr Faceting on products by using the
> DataImportHandler to import data from my database. I have setup my
> data-config.xml with the proper queries and schema.xml with the fields.
> After the import/index is complete I can only search one productid record in
> Solr. For example of the three productid '10100039' records there are I am
> only able to search for one of those. Should I somehow disable unique ids?
> What is the best way of doing this?
>
> Below is the schema I am trying to index:
>
> +-----------+-------------+---------+------------+
> | productid | attributeid | valueid | categoryid |
> +-----------+-------------+---------+------------+
> |  10100039 |      331100 |    1580 |      10000 |
> |  10100039 |      331694 |    1581 |      10000 |
> |  10100039 |    33113319 | 1537370 |      10000 |
> |  10100040 |      331100 |    1580 |      10000 |
> |  10100040 |      331694 | 1540230 |      10000 |
> |  10100040 |    33113319 | 1537370 |      10000 |
> +-----------+-------------+---------+------------+
>
> Thanks!
>