Search for null

2007-07-23 Thread testn
Is it possible to search for the document that specified field doesn't exist or such field value is null? -- View this message in context: http://www.nabble.com/Search-for-null-tf4130600.html#a11746864 Sent from the Lucene - Java Users mailing list archive at Nabbl

Re: Search for null

2007-07-23 Thread Erik Hatcher
On Jul 23, 2007, at 11:32 AM, testn wrote: Is it possible to search for the document that specified field doesn't exist or such field value is null? This is from Solr, so I'm not sure off the top of my head if this mojo applies by itself, but a search for -fieldname:[* TO *] will result

Re: Search for null

2007-07-23 Thread Les Fletcher
Does this particular range query have any significant performance issues? Les Erik Hatcher wrote: On Jul 23, 2007, at 11:32 AM, testn wrote: Is it possible to search for the document that specified field doesn't exist or such field value is null? This is from Solr, so I'm not sure off the

Re: Search for null

2007-07-23 Thread Jay Yu
If you want performance, a better way might be to assign some special string/value (if it's easy to create) to the missing field of docs and index the field without tokenizing it. Then you may search for that special value to find the docs. Jay Les Fletcher wrote: Does this particular range

Re: Search for null

2007-07-24 Thread daniel rosher
Perhaps you can use a filter in the following way. -Create a filter (via QueryFilter) that would contain all document that do not have null values for the field -flip the bits of the filter so that it now contains documents that have null values for a field -Use the filter in conjunction with subs

Re: Search for null

2007-07-24 Thread testn
ee only. It may contain > privileged > information. The contents are not to be disclosed to anyone other than the > addressee. > Unauthorised recipients are requested to preserve this confidentiality and > to advise > us of any errors in transmission. Thank you. > > hotonline ltd is registered in England &

Re: Search for null

2007-07-24 Thread Yonik Seeley
On 7/24/07, daniel rosher <[EMAIL PROTECTED]> wrote: Perhaps you can use a filter in the following way. -Create a filter (via QueryFilter) that would contain all document that do not have null values for the field -flip the bits of the filter so that it now contains documents that have null valu

Re: Search for null

2007-07-24 Thread Erick Erickson
isclosed to anyone other than the > addressee. > Unauthorised recipients are requested to preserve this confidentiality and > to advise > us of any errors in transmission. Thank you. > > hotonline ltd is registered in England

Re: Search for null

2007-07-24 Thread Jay Yu
daniel rosher wrote: Perhaps you can use a filter in the following way. -Create a filter (via QueryFilter) that would contain all document that do not have null values for the field Interesting: what does the QueryFilter look like? Isn't it just as hard as finding out what docs have the null

Re: Search for null

2007-07-25 Thread daniel rosher
You will be unable to search for fields that do not exist which is what you originally wanted to do, instead you can do something like: -Establish the query that will select all non-null values TermQuery tq1 = new TermQuery(new Term("field","value1")); TermQuery tq2 = new TermQuery(new Term("fiel

Re: Search for null

2007-07-25 Thread Jay Yu
what if I do not know all possible values of that field which is a typical case in a free text search? daniel rosher wrote: You will be unable to search for fields that do not exist which is what you originally wanted to do, instead you can do something like: -Establish the query that will sel

Re: Search for null

2007-07-25 Thread daniel rosher
In this case you should look at the source for RangeFilter.java. Using this you could create your own filter using TermEnum and TermDocs to find all documents that had some value for the field. You would then flip this filter (perhaps write a FlipFilter.java, that takes an existing filter in it

Re: Search for null

2007-07-25 Thread Daniel Noll
On Thursday 26 July 2007 03:12:20 daniel rosher wrote: > In this case you should look at the source for RangeFilter.java. > > Using this you could create your own filter using TermEnum and TermDocs > to find all documents that had some value for the field. That's certainly the way to do it for spe

Search for null value or empty string in lucene

2006-12-06 Thread Supriya Kumar Shyamal
Hi, I have some question regarding the search. In a document we can have several fields but not all fields have the value in all documents i.e. some fields in a document can have null or empty string. But how to search for a null field value in a document using the IndexSearcher? Any idea wil

Re: Search for null value or empty string in lucene

2006-12-06 Thread Erick Erickson
Perhaps the most straight-forward way would be to index a known unique value for each document that would have had a null entry. Conceptually, when a field would be null, index the value "nothinghere". Then you can just search on documents where the value is equal to "nothinghere". Alternatively,