Hi, You'd need to either expand the query or index the documents in a manner that they store the extra ontology related information. You may try going for the later option in case your mappings change often, though it'd be slow as you'd be adding more terms to the query. You could try using something like a synonym analyzer while conducting search in this case.
-- Anshum Gupta Naukri Labs! http://ai-cafe.blogspot.com The facts expressed here belong to everybody, the opinions to me. The distinction is yours to draw............ On Fri, Apr 23, 2010 at 2:39 AM, Wei Yi <jasonwe...@gmail.com> wrote: > Dear all, > > I want to provide hierarchical matching in Lucene. For example, > in a document, there is a field and its value: > > transportation: vehicle > > and suppose there is a class/subclass relationship saying that > car is a subclass of vehicle, and bus is a subclass of vehicle. > > I want the query: > transportation: car > to match the document because car is a subclass of vehicle. > > Is it possible to change the part where Lucene decide if a term is matched? > So I can take the subclass relationship into account? > > > Many thanks. > -- > Jason Wei > Chair of Software Engineering, ETH Zurich >