lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: lucene wildcard query with stop character
Date Tue, 17 Jun 2008 05:11:00 GMT

: Hrm.. can we see a more specific example of the type of data you are trying to
: query against here?

As i understand the question, this is a fairly classic hierarchical 
organization of documents.  Documents Foo>Bar>Baz and Foo>Bar>Bax are both 
children of Document Foo>Bar ... Foo>Barber is their aunt (a sibling 
document of Foo>Bar.

searching for  doc:Foo>Bar>*  will find all of the decendents of document 
Foo>Bar ... but you want to just find the direct children (not hte grand 
children)

the easiest way to tackled something like this is with multiple fields...

   doc_path: Foo>Bar>Baz
   parent:   Foo>Bar

..then you can query for parent:"Foo>Bar" to find all of the direct 
children, or doc:Foo>Bar>* to find all decendents.

i typically use an "ancestors" field, where every ancestor in the "family 
tree" is enumerated as a seperate field value, so that i'm not dependent 
on prefix queries to do "decendents" queries like that....

   doc_path: Foo>Bar>Baz
   parent:   Foo>Bar
   ancestor: Foo>Bar
   ancestor: Foo



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message