I'm using Lucene to index documents consisting of fragments. The document as a whole consists of fields describing it (ie. author, title, publish date). Fragments contain text and tags (keywords). I would like to be able to:
- search for all fragments by author, which have tag Foo.
- search for all documents by title.
- search for all documents, which contain some words (in any fragment)
I read about BlockJoinQuery in Lucene, but I am not sure if it's suitable for my problem: for instance, having a following document:
document: title="Hello World" author="Sam Brown"
fragment 1: tags="sunny" text="...."
fragment 2: tags="cloudy" text="moody and sleepy"
would I be able to find this document with a query:
tags:sunny and text:sleepy
?
Such query will not match any child document(fragment), but perhaps it would match the parent - the lucene documentation does not state that though.