Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-04 Thread Luke Shannon
Very Nice. Thanks! Luke - Original Message - From: [EMAIL PROTECTED] To: Lucene Users List lucene-user@jakarta.apache.org Sent: Friday, February 04, 2005 2:12 AM Subject: Re: Parsing The Query: Every document that doesn't have a field containing x I think you may can use a filter to

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-04 Thread Chris Hostetter
Another approach... You can make a Filter that is the inverse of the output from another filter, which means you can make a QueryFilter on the search, then wrap it in your inverse Filter. you can't execute a query on a filter without having a Query object, but you can just apply the Filter

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-04 Thread Luke Shannon
Thanks for everyone who has been posting possible solutions. I am making great progress and learning a lot. This works, but the results include files that don't even contain a kcfileupload field (not good): query1 = QueryParser.parse(jpg, kcfileupload, new StandardAnalyzer()); query2 =

Re: Parsing The Query: Every document that doesn't have a field containing x (but still has the field)

2005-02-04 Thread Luke Shannon
Hello; I think Chris's approach might be helpfull, but I can't seems to get it to work. So since I running out of time and I still need to figure out starts with and ends with queries, I have implemented a hacky solution to getting all documents with a kcfileupload field present that does not

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Kelvin Tan
Alternatively, add a dummy field-value to all documents, like doc.add(Field.Keyword(foo, bar)) Waste of space, but allows you to perform negated queries. On Thu, 03 Feb 2005 19:19:15 +0100, Maik Schreiber wrote:  Negating a term must be combined with at least one nonnegated  term to return

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Luke Shannon
Ok. I have added the following to every document: doc.add(Field.UnIndexed(olFaithfull, stillHere)); The plan is a query that says: olFaithull = stillHere and kcfileupload!=jpg. I have been experimenting with the MultiFieldQueryParser, this is not working out for me. From a syntax how is this

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Luke Shannon
Hello, Still working on the same query, here is the code I am currently working with. I am thinking this should bring up all the documents that have olFaithFull=stillHere and kcfileupload!=jpg (so anything else) query1 = QueryParser.parse(jpg, kcfileupload, new StandardAnalyzer()); query2 =

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Maik Schreiber
-kcfileupload:jpg +olFaithFull:stillhere This looks right to me. Why the 0 results? Looks good to me, too. You sure all your documents have olFaithFull:stillhere and there is at least a document with kcfileupload not being jpg? -- Maik Schreiber * http://www.blizzy.de -- Get GMail invites

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Luke Shannon
Yes. There should be 119 with stillHere, and if I run a query in Luke on kcfileupload = ppt, it returns one result. I am thinking I should at least get this result back with: -kcfileupload:jpg +olFaithFull:stillhere? Luke - Original Message - From: Maik Schreiber [EMAIL PROTECTED] To:

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Maik Schreiber
Yes. There should be 119 with stillHere, You have double-checked that, haven't you? :) and if I run a query in Luke on kcfileupload = ppt, it returns one result. I am thinking I should at least get this result back with: -kcfileupload:jpg +olFaithFull:stillhere? You really should. -- Maik

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Luke Shannon
I did, I have ran both queries in Luke. kcfileupload:ppt returns 1 olFaithfull:stillhere returns 119 Luke - Original Message - From: Maik Schreiber [EMAIL PROTECTED] To: Lucene Users List lucene-user@jakarta.apache.org Sent: Thursday, February 03, 2005 4:55 PM Subject: Re: Parsing

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Luke Shannon
This works: query1 = QueryParser.parse(jpg, kcfileupload, new StandardAnalyzer()); query2 = QueryParser.parse(stillHere, olFaithFull, new StandardAnalyzer()); BooleanQuery typeNegativeSearch = new BooleanQuery(); typeNegativeSearch.add(query1, false, false); typeNegativeSearch.add(query2, false,

RE: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Kauler, Leto S
First thing that jumps out is case-sensitivity. Does your olFaithFull field contain stillHere or stillhere? --Leto -Original Message- From: Luke Shannon [mailto:[EMAIL PROTECTED] This works: query1 = QueryParser.parse(jpg, kcfileupload, new StandardAnalyzer()); query2 =

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Luke Shannon
stillHere Capital H. - Original Message - From: Kauler, Leto S [EMAIL PROTECTED] To: Lucene Users List lucene-user@jakarta.apache.org Sent: Thursday, February 03, 2005 6:40 PM Subject: RE: Parsing The Query: Every document that doesn't have a field containing x First thing that jumps

RE: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Kauler, Leto S
Because you are build from QueryParser rather than a TermQuery, all search terms in the query are being lowercased by StandardAnalyzer. So your query of olFaithFull:stillhere requires that there is an exact index term of stillhere in that field. It depends on how you built the index (index and

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread Luke Shannon
Bingo! Nice catch. That was it. Made everything lower case when I set the field. Works great now. Thanks! Luke - Original Message - From: Kauler, Leto S [EMAIL PROTECTED] To: Lucene Users List lucene-user@jakarta.apache.org Sent: Thursday, February 03, 2005 6:48 PM Subject: RE: Parsing

Re: Parsing The Query: Every document that doesn't have a field containing x

2005-02-03 Thread
I think you may can use a filter to get right result! See examlples below package lia.advsearching; import junit.framework.TestCase; import org.apache.lucene.analysis.WhitespaceAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import