lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Rodenburg <>
Subject Re: Items in multiple category: distinct search?
Date Tue, 15 Nov 2005 20:38:05 GMT
Hi John -

It sounds like you're thinking of your index in terms of sql constructs --
multiple rows for the same record. We do this very same thing with
categories; if you have a record that lives in multiple categories, just add
additional category field/value pairs for your original record. It's ok to
use multiple fields with the same name. Once stored, if you want to see
records in category "A", just query lucene for category "A". Thinking of it
in terms of SQL constructs makes it more difficult than it needs to be.

Hope this helps.

On 11/15/05, John Powers <> wrote:
> Hello, I have done a search for this issue, but I didnt really see an
> answer.
> if i want to store things in a hierarchy, but i want items to be in
> multiple
> categories at any level. i'd like to be able to search for an item and
> only show it once, but maybe (not required) show what categories the
> results
> are in. but if i look in a category (search on that category) then i want
> to see that item there obviously only the once that it is there.
> so i've got the hierarchy part..but its getting items to be in multiple
> categories. i can put them there as duplicate entries of that itemNumber,
> however when i search i dont want to get back the 7 times that one item is
> used.. i dont mind if its in 7 categories and they each show one usage,
> but
> i'd like for my total hit count to reflect just that this item exists
> once... i could iterate through the whole Hits list and put them into a
> unique result list, but i'd like lucene to do that for me. any way to do
> that? custom filter? i've looked at the query language..i didnt see a
> "distinct" clause...
> any help is greatly appreciated.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message