lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Terms Matching Query
Date Tue, 21 Oct 2008 23:32:16 GMT

Dislaimer: I don't really understand your goal, or JSON, so i'm only 
addressing the part of your question i do understand, but i may be 
overlooking something obvious that could help you...

: Which would get expanded to the obvious "name.first:Paul
: name.last:Paul". I was planning on just doing a search for
: __JSON_PATH__:name.* collecting the terms and doing an OR like what
: the old Prefix/Range queries. (I think I read that RangeQueries are
: different now, but right now I'm going for Make It Work)
: So anyway, long story short, is there a way to get just the list of
: terms that match an arbitrary lucene query?

If i'm understanding this part, you don't care about hte results of the 
query, you just wnat to know what Terms match a prefix ... directly using 
the TermEnum is probably the most straight forward way to do this.

: I tried poking at Query.extractTerms(Set terms) but it appears to fall
: down for RangeQueries. I contemplated telling the query parser to use

extractTerms should work fine when dealing with a RangeQuery (but not a 
constantScoreRangeQuery) but the trick is extractTerms only makes sense on 
a query once it has been rewritten (at which point hte RnageQuery is 
expanded to a BooleanQuery containing all of the terms)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message