Re: How to search for -2 in field?

2008-12-12 Thread Darren Govoni
Tried them all, with quotes, without. Doesn't work. At least in Luke it doesn't. On Fri, 2008-12-12 at 07:03 +0530, prabin meitei wrote: whitespace analyzer will tokenize on white space irrespective of quotes. Use standard analyzer or keyword analyzer. Prabin meitei toostep.com On Thu, Dec

Re: How to search for -2 in field?

2008-12-12 Thread prabin meitei
one more thing, few times I have encountered that I get different results in Luke then in my actual code. Try in your code directly using standard analyzer and quoted query string. print your query to check if the query formed is correct (query is formed with quoted string). Can you tell what

Re: How to search for -2 in field?

2008-12-12 Thread Matthew Hall
Are you absolutely, 100% sure that the -2 token has actually made it into your index? As a VERY basic way to check this try something like this: import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.TermEnum; public class IndexTerms { public static void

Re: How to search for -2 in field?

2008-12-12 Thread Greg Shackles
I admit I only read through this thread quickly so maybe I missed something, but it sounds like you're trying different Analyzers for searching, when what you really need is to use the right analyzer during indexing. Generally you want to use the same analyzer for both indexing and searching so

Re: How to search for -2 in field?

2008-12-12 Thread Darren Govoni
Hi Matt, Thanks for the thought. Yeah, I see it there in Luke, but the other gentleman's idea that maybe Luke is producing different than code might be a clue. It would be odd, if true, but nothing else works so I will see if that is it. Darren On Fri, 2008-12-12 at 08:03 -0500, Matthew Hall

Re: How to search for -2 in field?

2008-12-11 Thread Robert Young
You could do it with a TermQuery but I'm not quite sure if that's the answer you're looking for. Cheers Rob On Thu, Dec 11, 2008 at 3:59 PM, Darren Govoni [EMAIL PROTECTED] wrote: Hi, This might be a dumb question, but I have a simple field like this field: 0 -2 Word that is

Re: How to search for -2 in field?

2008-12-11 Thread Darren Govoni
I'm hoping to do this with a simple query string, but not sure if its possible. I'll try your suggestion though as a workaround. Thanks!! On Thu, 2008-12-11 at 16:48 +, Robert Young wrote: You could do it with a TermQuery but I'm not quite sure if that's the answer you're looking for.

Re: How to search for -2 in field?

2008-12-11 Thread prabin meitei
Hi, While constructing the query give the query string in quotes. eg: query = queryparser.parse(\-2 word\); Prabin meitei toostep.com On Thu, Dec 11, 2008 at 10:37 PM, Darren Govoni [EMAIL PROTECTED] wrote: I'm hoping to do this with a simple query string, but not sure if its possible. I'll

Re: How to search for -2 in field?

2008-12-11 Thread Darren Govoni
I'm using Luke to find the right combination of quotes,\'s and analyzers. No combination can produce a positive result for -2 String for the field 'type'. (any -number String) type: 0 -2 Word analyzer: query - rewritten = result default field is 'type'. WhitespaceAnalyzer: \-2

Re: How to search for -2 in field?

2008-12-11 Thread prabin meitei
whitespace analyzer will tokenize on white space irrespective of quotes. Use standard analyzer or keyword analyzer. Prabin meitei toostep.com On Thu, Dec 11, 2008 at 11:28 PM, Darren Govoni dar...@ontrenet.com wrote: I'm using Luke to find the right combination of quotes,\'s and analyzers.