lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Thrysøe <>
Subject Re: PrefixQuery and hieracical queries problem
Date Fri, 19 Mar 2004 15:37:19 GMT
Andrzej Bialecki wrote:
> Dennis Thrysøe wrote:
>> Andrzej Bialecki wrote:
>>> What about using PhraseQuery, and store the path with all but first 
>>> path separator replaced by whitespace (i.e. "/foo bar baz one two 
>>> three"). Then you could query for "/foo bar", "/foo bar baz", and so 
>>> on...
>> Hi,
>> It doesn't seem to work though - unless I'm missing something.
>> I've tried to index the field both as Keyword and as UnStored.
>> I'm constructing a PhraseQuery myself (no query parser used), so I 
>> don't know if I should add a single or multiple terms to the PhraseQuery.
>> The following (simplified) debug output gives no hits:
>> ADDING: Document<org.apache.lucene.document.Field@7bc0ac 
>> Keyword<name:art> Keyword<uri:/dt art>>
>> SEARCHING: +(name:art) +uri:"/dt "
> Why the trailing space?

Because in this case the paths to folders actually end with a path 
seperator character. I guess I'll just remove it.

> Anyway.. I should've added that for Phrase Queries to work the text must 
> be tokenized. So, the best way in this case would be to use 
> WhitespaceAnalyzer for the uri field, and store it as Field.Text(...).

Right, thanks. I was just experimenting with that, but the stop analyzer 
seems to remove the leading slash.

I'll try your suggestion.



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

View raw message