: This approach works (I do a similar thing using solr), but you have to be
: careful as BooleanQuery.TooManyClauses exception can be thrown depending where
: you use the wild card. It should be fine in the case you described however.

You'll never get a TooManyClauses from a prefix or range query in Solr, it 
uses Filters instead of the default query classes.

: > Why not just use the whole path as the unique identifying token for a given
: > node on the hierarchy?   That way, you don't need to map nodes to unique
: > numbers, just use a prefix query.

personally, i don't create a numeric->text mapping just to do this ... i 
already have the numeric mappings in my data, so it's *easier* for me to 
use the numericIds in Solr (one really key reason to do things this way 
is that i can change the name of a topic without reindexing every 
document mapped to that topic)

Term queries should also be a little faster then prefix queries, but i 
won't swear to that.  If you do go the prefix query route, make sure to 
leave on a trailing marker character so you don't run the risk of one 
Topic name being the prefix of a sister topic name...

taxonomy:Place/NorthAmerica/USA/Washington* will match 
Place/NorthAmerica/USA/Washington/Seattle/ and 
Place/NorthAmerica/USA/WashingtonDC/ ... so use 
taxonomy:Place/NorthAmerica/USA/Washington/*


-Hoss

Reply via email to