Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

Linking Fields to Documents possible?

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


nabblegm0il at gmail

Nov 23, 2009, 1:05 AM

Post #1 of 5 (582 views)
Permalink
Linking Fields to Documents possible?

Hi,

I have a requirement where I have a list of Suppliers(documents for lucene
index) and a list of Products(documents again). Each Product has a supplier.
e.g. :
Product -> RouterX, Supplier -> DLink, Netgear
Product -> RouterY, Supplier -> Cisco

If I search for Cisco, RouterY should show up. If I implement the supplier
as a Field in the Document - Router, I will have to update all the Products
if the name of a Supplier changes.

Can I not just link the field - supplier in Product to the Supplier somehow
rather than duplicating ??

-thanks
--
View this message in context: http://old.nabble.com/Linking-Fields-to-Documents-possible--tp26474610p26474610.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


nabblegm0il at gmail

Nov 23, 2009, 1:06 AM

Post #2 of 5 (538 views)
Permalink
Linking Fields to Documents possible? [In reply to]

Hi,

I have a requirement where I have a list of Suppliers(documents for lucene
index) and a list of Products(documents again). Each Product has a supplier.
e.g. :
Product -> RouterX, Supplier -> DLink, Netgear
Product -> RouterY, Supplier -> Cisco

If I search for Cisco, RouterY should show up. If I implement the supplier
as a Field in the Document - Router, I will have to update all the Products
if the name of a Supplier changes.

Can I not just link the field - supplier in Product to the Supplier somehow
rather than duplicating ??

-thanks
--
View this message in context: http://old.nabble.com/Linking-Fields-to-Documents-possible--tp26474610p26474610.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


ian.lea at gmail

Nov 23, 2009, 2:09 AM

Post #3 of 5 (551 views)
Permalink
Re: Linking Fields to Documents possible? [In reply to]

Lucene is not a database. You'll need to flatten the data and yes,
that does mean duplication.


--
Ian.


On Mon, Nov 23, 2009 at 9:05 AM, sameerpatil <nabblegm0il [at] gmail> wrote:
>
> Hi,
>
>  I have a requirement where I have a list of Suppliers(documents for lucene
> index) and a list of Products(documents again). Each Product has a supplier.
> e.g. :
> Product -> RouterX, Supplier -> DLink, Netgear
> Product -> RouterY, Supplier -> Cisco
>
> If I search for Cisco, RouterY should show up. If I implement the supplier
> as a Field in the Document - Router, I will have to update all the Products
> if the name of a Supplier changes.
>
> Can I not just link the field - supplier in Product to the Supplier somehow
> rather than duplicating ??
>
> -thanks
> --
> View this message in context: http://old.nabble.com/Linking-Fields-to-Documents-possible--tp26474610p26474610.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


erickerickson at gmail

Nov 23, 2009, 4:44 AM

Post #4 of 5 (531 views)
Permalink
Re: Linking Fields to Documents possible? [In reply to]

There are some tricks you can apply, but they amount to
keeping your own lists and manipulating them manually. As Ian
says, Lucene isn't a database, and if you find yourself spending
much time trying to *make* it behave like a database you should
probably re-think your approach.

But in this case, you could say use an ID for your supplier and
keep a separate document with fields not in your usual schema
(remember, there's no requirement that all docs have the same
fields), read in and cache that document and use *it* to make
the correlation. Then, when your suppliers changed their names,
you'd only have to change one doc.

But then you have to look up your supplier names in the
document and substitute those IDs into your queries. And
use the "special" doc to lookup the names for display and.....
You see where this leads, each step in and of itself isn't
very hard, but pretty soon you're writing a RDMBS.

But is it worth it? How often does the supplier in your example
change their name? And how painful is reindexing? I've
often found that it's not that difficult to just reindex as necessary.

Best
Erick

On Mon, Nov 23, 2009 at 4:05 AM, sameerpatil <nabblegm0il [at] gmail> wrote:

>
> Hi,
>
> I have a requirement where I have a list of Suppliers(documents for lucene
> index) and a list of Products(documents again). Each Product has a
> supplier.
> e.g. :
> Product -> RouterX, Supplier -> DLink, Netgear
> Product -> RouterY, Supplier -> Cisco
>
> If I search for Cisco, RouterY should show up. If I implement the supplier
> as a Field in the Document - Router, I will have to update all the Products
> if the name of a Supplier changes.
>
> Can I not just link the field - supplier in Product to the Supplier somehow
> rather than duplicating ??
>
> -thanks
> --
> View this message in context:
> http://old.nabble.com/Linking-Fields-to-Documents-possible--tp26474610p26474610.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>


nabblegm0il at gmail

Nov 23, 2009, 12:14 PM

Post #5 of 5 (525 views)
Permalink
Re: Linking Fields to Documents possible? [In reply to]

Thanks guys, I get the point, it is best to reindex(hope it isnt very
expensive). And yes, it's true that the suppliers dont change often. I
--
View this message in context: http://old.nabble.com/Linking-Fields-to-Documents-possible--tp26474610p26485036.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.