Lucene raise document score if sibling entity matches query

Posted by Pitagoras on Stack Overflow See other posts from Stack Overflow or by Pitagoras
Published on 2012-06-24T21:11:23Z Indexed on 2012/06/24 21:15 UTC
Read the original article Hit count: 162

I have the following design situation. I use hibernate search (lucene in the back).

Tha application manages ITEMs which have title, description and tags. These are full text indexed.

On the other hand, we have COLLECTION of ITEMs. The user can create a COLLECTION and add as many ITEMs as she wants. ITEMs can also belong to many COLLECTIONs. I have a boosted query so that search terms that appear in the tags are more important than in the title, and lastly in the description.

But I need an additional matching criteria: for a given ITEM, it whould rank better if other documents in some COLLECTION where the ITEM belongs, also match the query. This is like to say: the title/tags/description of "fellow" items (i.e. items in some shared collection) make the item rank better.

I was thinking that adding an ITEM to a COLLECTION would add something like "extra tags" to every other ITEM in the collection, being these extra tags the elements to match in the added ITEM.

I feel a more clever solution lucene-wise should exists. Any ideas/pointers are welcome.

Thanks.

© Stack Overflow or respective owner

Related posts about lucene

Related posts about full-text-search