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

Mailing List Archive: Lucene: General

DuplicateFilter on search results

 

 

Lucene general RSS feed   Index | Next | Previous | View Threaded


udaysasi at gmail

Dec 22, 2008, 1:04 PM

Post #1 of 2 (776 views)
Permalink
DuplicateFilter on search results

Hello All,

I am new to this forum and I have a question where I am stuck and would
appreciate any pointers or inputs.

I have created a Lucene index from a Database table. I am trying to apply a
Duplicate Filter on an attribute while searching for another attribute.

Lets say for example(and simplicity), I have columns like username, itemname
and that the index looks like the following :

username itemname item description docid
--------- --------- --------------- -----
john laptop Lenovo 0
eric pda Blackberry 1
john iphone Apple 2
john pda Blackberry 3
monica iphone Apple 4
john laptop Dell 5

Now, My question is - how do I get all the unique items that a particular
person (Say, John) contains?

I tried to query the index with username:john and tried to apply a
DuplicateFilter on itemname column while searching. What I get in the
results is just the laptop and iphone. Looks like the duplicate filter is
applied on the entire index which eliminates anything but the
FIRST_OCCURENCE of the item pda. Hence the filter yeilds only doc ids : 0,
1, 2 and among them, the search yeilds only docs 0 and 2 when I search for
username:john

Is there a way to apply duplicatefilter on the search results? Like - Get
all records for John and Get all Unique itemnames under his name.

I am not sure if I was clear enough explaining my problem. Please throw some
light on this if you have encountered such issue and was able to find a way
to do this.

I did some googling and found ways to join queries using BooleanFilter to
add a subquery to an existing query. What I am trying to do is to add a
filter to a query result.

Thanks
-Uday
--
View this message in context: http://www.nabble.com/DuplicateFilter-on-search-results-tp21134975p21134975.html
Sent from the Lucene - General mailing list archive at Nabble.com.


udaysasi at gmail

Dec 22, 2008, 1:05 PM

Post #2 of 2 (712 views)
Permalink
DuplicateFilter on search results [In reply to]

Hello All,

I am new to this forum and I have a question where I am stuck and would
appreciate any pointers or inputs.

I have created a Lucene index from a Database table. I am trying to apply a
Duplicate Filter on an attribute while searching for another attribute.

Lets say for example(and simplicity), I have columns like username, itemname
and that the index looks like the following :


username itemname item description docid
--------- --------- --------------- -----
john laptop Lenovo 0
eric pda Blackberry 1
john iphone Apple 2
john pda Blackberry 3
monica iphone Apple 4
john laptop Dell 5

Now, My question is - how do I get all the unique items that a particular
person (Say, John) contains?

I tried to query the index with username:john and tried to apply a
DuplicateFilter on itemname column while searching. What I get in the
results is just the laptop and iphone. Looks like the duplicate filter is
applied on the entire index which eliminates anything but the
FIRST_OCCURENCE of the item pda. Hence the filter yeilds only doc ids : 0,
1, 2 and among them, the search yeilds only docs 0 and 2 when I search for
username:john

Is there a way to apply duplicatefilter on the search results? Like - Get
all records for John and Get all Unique itemnames under his name.

I am not sure if I was clear enough explaining my problem. Please throw some
light on this if you have encountered such issue and was able to find a way
to do this.

I did some googling and found ways to join queries using BooleanFilter to
add a subquery to an existing query. What I am trying to do is to add a
filter to a query result.

Thanks
-Uday
--
View this message in context: http://www.nabble.com/DuplicateFilter-on-search-results-tp21134990p21134990.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Lucene general 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.