You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Robinson Raju <ro...@gmail.com> on 2004/10/09 16:24:53 UTC
A simple newbee question . How do i exclude a field ?
Hi ,
i use lucene to search against a flatted DB table.
I have a table which contains the following data .
there are 3 records which contain the code RN ,
27 which contain UD
and 3266 which contain BLANK.
code Number of records
------- -------------------------
3269
RN 3
UD 27
if my searchString is "RN" , i get 3
if my searchString is "UD" , i get 27
if my searchString is "" , i get 3296 (in this case i bypass queryfilter)
Now , I need to get number of records which do not contain UD .
(similar to a DB query of NOT IN or !=).
if the string is "-UD" , it doesnt work.
Could you tell me how to construct a string for this ?
Regards
Robin
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
RE: A simple newbee question . How do i exclude a field ?
Posted by Aviran <am...@infosciences.com>.
For the records that don't contain a field you can put a bogus value such as
"empty" and then you can query on -UD:empty
Aviran
http://aviran.mordos.com
-----Original Message-----
From: Robinson Raju [mailto:robinson.raju@gmail.com]
Sent: Saturday, October 09, 2004 10:25 AM
To: Lucene Users List
Subject: A simple newbee question . How do i exclude a field ?
Hi ,
i use lucene to search against a flatted DB table.
I have a table which contains the following data .
there are 3 records which contain the code RN ,
27 which contain UD
and 3266 which contain BLANK.
code Number of records
------- -------------------------
3269
RN 3
UD 27
if my searchString is "RN" , i get 3
if my searchString is "UD" , i get 27
if my searchString is "" , i get 3296 (in this case i bypass queryfilter)
Now , I need to get number of records which do not contain UD . (similar to
a DB query of NOT IN or !=). if the string is "-UD" , it doesnt work.
Could you tell me how to construct a string for this ?
Regards
Robin
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org