in your query parser, you'll need to use an Analyzer that knows that
"documenttype" should not be tokenized, and the raw user string entered by
the user should be treated as the query Term value.

you can make you own analyzer that subclass StandardAnalyzer and only does
the special behavior for that specific field very easily.  if you have
complex rules that require very differnet analyzers for lots of differnet
fields, you'll probably want to look at PerFieldAnalyzerWrapper.


: Date: Wed, 11 May 2005 15:05:21 +0200
: From: "Lilja, Bjorn" <[EMAIL PROTECTED]>
: Reply-To: java-user@lucene.apache.org
: To: java-user@lucene.apache.org
: Subject: RE: Strange results using QueryParser (?)
:
:
: Hi,
:
: Daniel's suggestions was quite correct. Is the "/" suposed to be turned into 
a whitespace? In that case, how do I stop it? I do wish to search for the 
entire exact word "Blankett/Mall".
:
: Regards,
: Björn
:
: _____________________________________________________________
: Björn Lilja | Technology Services | Consultant
: Tel: +46 8 5368 5000
: Mob: +46 702 651 027
:
: Capgemini
: www.se.capgemini.com | We help companies and their employees to achieve more.
:
: -----Original Message-----
: From: Daniel Naber [mailto:[EMAIL PROTECTED]
: Sent: Tuesday, May 10, 2005 5:17 PM
: To: Lilja, Bjorn
: Subject: Re: Strange results using QueryParser (?)
:
: On Tuesday 10 May 2005 17:04, Lilja, Bjorn wrote:
:
: > I first suspected the "/"-sign to be the cause of the problem, but
: > searching for "documenttype:blankett/ma*" actually returns the
: > expected result.
:
: I suggest you use toString() on the parsed query. The "/" is probably 
interpreted like a whitespace and you may end up with a query 
"documenttype:blankett mall", i.e. "mall" searched in the default field, not in 
documenttype.
:
: If that doesn't help you could create a small test case (index and search 
just one document) and post that to the list.
:
: Regards
:  Daniel
:
: --
: Daniel Naber, IntraFind Software AG, Tel. 089-8906 9700
:
:
:
: This message contains information that may be privileged or confidential and 
is the property of the Capgemini Group. It is intended only for the person to 
whom it is addressed. If you are not the intended recipient,  you are not 
authorized to read, print, retain, copy, disseminate,  distribute, or use this 
message or any part thereof. If you receive this  message in error, please 
notify the sender immediately and delete all  copies of this message.
:
:
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: [EMAIL PROTECTED]
: For additional commands, e-mail: [EMAIL PROTECTED]
:



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to