Re: Searching for Empty Field

2011-07-15 Thread Trejkaz
On Fri, Jul 15, 2011 at 4:45 PM, Uwe Schindler wrote: > Hi, > >> The crappy thing is that to actually detect if there are any tokens in the >> field >> you need to make a TokenStream which can be used to read the first token >> and then rewind again.  I'm not sure if there is such a thing in Luce

RE: Searching for Empty Field

2011-07-14 Thread Uwe Schindler
Hi, > The crappy thing is that to actually detect if there are any tokens in the > field > you need to make a TokenStream which can be used to read the first token > and then rewind again. I'm not sure if there is such a thing in Lucene at the > moment. We had to write it ourselves but we were

Re: Searching for Empty Field

2011-07-14 Thread Trejkaz
On Fri, Jul 15, 2011 at 10:02 AM, Trieu, Jason T wrote: > Hi all, > > I read postings about searching for empty field with but did not find any > cases of successful search using query language syntax itself(-myField:[* TO > *] for example). We have been using: -myField:* You would need to us

Re: Searching for Empty Field

2011-07-14 Thread findbestopensource
Hi Jason, The easiest way would be to set some default value for the field which is empty, Say EMPTY and search for this string to check out the records having empty field. Regards Aditya www.findbestopensource.com On Fri, Jul 15, 2011 at 5:32 AM, Trieu, Jason T wrote: > Hi all, > > I read pos

Re: searching for empty field

2007-06-11 Thread Erik Hatcher
On Jun 11, 2007, at 9:53 AM, Dino wrote: Now my question is how will I search for all the documents with *empty* Field2? You can search for "-field2:[* TO *] AND *:*" essentially. With Solr, the *:* isn't needed, but is with pure Lucene to ensure a positive query also. Erik

Re: searching for empty field

2007-06-11 Thread Erick Erickson
You don't as far as I know. One solution that has been suggested is to always index field2, but with a noop value. This works pretty well if you choose a value you'd never search for, say xzxzxzxzxzxzxzx. Then you can search field2 for that special value to get the *empty* case. Best Erick On 6/

RE: searching for empty field

2007-06-11 Thread Mordo, Aviran (EXP N-NANNATEK)
AFAIK there is no strait way of doing that, however you can create another field (field4) which can indicate if field2 exists. HTH Aviran http://www.aviransplace.com http://shaveh.co.il -Original Message- From: Dino [mailto:[EMAIL PROTECTED] Sent: Monday, June 11, 2007 9:54 AM To: java