lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chad Small" <Chad.Sm...@definityhealth.com>
Subject RE: Query syntax on Keyword field question
Date Wed, 24 Mar 2004 14:08:45 GMT
For others reference - here is the old version url:
 
https://javacc.dev.java.net/servlets/ProjectDocumentList?folderID=212

	-----Original Message----- 
	From: Chad Small 
	Sent: Wed 3/24/2004 8:07 AM 
	To: Lucene Users List 
	Cc: 
	Subject: RE: Query syntax on Keyword field question
	
	

	thanks.  I was in the process of getting javacc3.2 setup.  I'll have to hunt for 2.x.
	
	chad.
	
	        -----Original Message-----
	        From: Morus Walter [mailto:morus.walter@tanto.de]
	        Sent: Wed 3/24/2004 8:00 AM
	        To: Lucene Users List
	        Cc:
	        Subject: RE: Query syntax on Keyword field question
	       
	       
	
	        Hi Chad,
	       
	        > But I assume this fix won't come out for some time.  Is there a way I can get
this fix sooner?
	        > I'm up against a deadline and would very much like this functionality.
	       
	        Just get lucenes sources, change the line and recompile.
	        The difficult part is to get a copy of JavaCC 2 (3 won't do), but I think
	        this can be found in the archives.
	       
	        >
	        > And to go one more step with the KeywordAnalyzer that I wrote, changing this
method to skip the escape:
	        >     protected boolean isTokenChar(char c)
	        >     {
	        >          if (c == '\\')
	        >          {
	        >             return false;
	        >          }
	        >          else
	        >          {
	        >             return true;
	        >          }
	        >       }
	        > The test then returns with a space:
	        >  healthecare.domain.lucenesearch.KeywordAnalyzer:
	        >   [HW-NCI_TOPICS]
	        > query.ToString = +category:"HW -NCI_TOPICS" +space
	        > junit.framework.ComparisonFailure: HW-NCI_TOPICS kept as-is
	        > Expected:+category:HW\-NCI_TOPICS +space
	        > Actual  :+category:"HW -NCI_TOPICS" +space   <----note space where escape
was.
	       
	        Sure. If \ isn't a token char, it end's the token.
	        So you will have to look for a different way of implementing the
	        analyzer. Shouldn't be that difficult since you have only one token.
	       
	        Maybe it should be the job of the query parser to remove the escape character
	        (would make more sense to me at least) but that would be another change
	        of the query parser...
	       
	        Morus
	       
	        ---------------------------------------------------------------------
	        To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
	        For additional commands, e-mail: lucene-user-help@jakarta.apache.org
	       
	       
	
	

Mime
View raw message