lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <li...@ehatchersolutions.com>
Subject Re: QueryParser question
Date Tue, 31 Dec 2002 12:48:26 GMT
I'd like to revisit this issue.  First, I add the path field to the 
Document in this way:

	doc.add(Field.Keyword("path", path));

This field is, of course, not tokenized by the Analyzer, right?  So 
shouldn't QueryParser take this fact into account on a field-by-field 
basis such that a query of "path:/whatever/blah" not be tokenized?

The analyzer used for the IndexWriter is not used for Keyword fields, 
right?

Is it possible to have this type of smarts in the QueryParser such that 
it takes the field type into consideration before using an Analyzer?  
Should this issue be taken to lucene-dev or Bugzilla as an enhancement 
request?  I want a sanity check on my thinking before doing so though.

Thanks,
	Erik


On Monday, December 30, 2002, at 11:59  AM, Otis Gospodnetic wrote:

> You could write an Analyzer that doesn't drop '/' character and use an
> instance of that Analzyer when you call QueryParser.parse method.
> I never used escape characters myself, and saw a lot of people
> complaining it does not work, however, you can check Lucene's
> QueryParser test class (in CVS under src/test or some place like that)
> which includes tests for escape chars.  From what I remember they use a
> different Analyzer (WhitespaceAnalyzer?  Maybe you can try that one
> before writing your own).
>
> Otis
>
> --- Erik Hatcher <lists@ehatchersolutions.com> wrote:
>> I have a keyword field that has a value like: "/path/to/something".
>> Is
>> there a way I can use QueryParser to get documents that have that
>> field
>> value?  It seems the Analyzer is kicking in and tokenizing it if I
>> query for "path:/path/to/something".  I tried several ways of
>> escaping
>> the slashes and quotes, but nothing seemed to work.  Help!
>>
>> Yes, I know I can do it by constructing a query through the API and
>> that works fine - but it'd be nicer, of course, if QueryParser did
>> the
>> trick.
>>
>> Thanks,
>> 	Erik
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
>> <mailto:lucene-user-help@jakarta.apache.org>
>>
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:   
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:lucene-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message