lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Granroth, Neal V." <>
Subject RE: Searching a group of associated multi-value fileds
Date Thu, 07 Apr 2011 15:38:47 GMT

One solution is to change the structure of your index.

Index each of your items as individual Lucene documents.

Include with the document an additional field containing an invoice-id.

This will allow you to use Lucene's search without difficulty, while also retaining the association
between items and invoices.

- Neal

-----Original Message-----
From: Sailesh [] 
Sent: Thursday, April 07, 2011 6:20 AM
Subject: Searching a group of associated multi-value fileds


I have scenario where i have so search multiple multi-valued fields, for
I have an invoice that contians may items and each item has many attributes

item id : 1, item_name : my item name1 , unit_price : 10
item id : 2, item_name : your item name2 , unit_price : 11
item id : 3, item_name : item name3 , unit_price : 12

The above items are part of single invoice, so cannot have them as separate

Now if I search for item-id = 2 and unit_price = 12 then it should not
return me anything.

If it would have been single I could have used phase or span queries but in
case of
multiple associated fields i don't how to handle it.

So if any body have ever tried or have any idea to handle this problem,
let me know


View this message in context:
Sent from the Lucene - General mailing list archive at

View raw message