1) Have you looked at what tokens your indexing analyzer produces when you tokenize "ES-20D" ? 2) Have you looked at what tokens your query analyser products when you tokenize "ES-20D" ? 3) Have you tried a simpler query (ie: just "content:es\-20d" ) ? 4) When giving QueryParser a (quoted) phrase search, i don't think you really want to escape that "-" character.
: Date: Thu, 23 Feb 2006 14:16:42 -0700 : From: Mufaddal Khumri <[EMAIL PROTECTED]> : Reply-To: java-user@lucene.apache.org : To: java-user@lucene.apache.org : Subject: Getting no hits ... : : I have been trying to figure out why my query below would not return any : hits. : : I use two custom analyzers for indexing and searching. The one I use for : indexing uses this: : : public TokenStream tokenStream(String fieldName, Reader reader) : { : TokenStream result = new StandardTokenizer(reader); : result = new StandardFilter(result); : result = new LowerCaseFilter(result); : result = new StopFilter(result, stopSet); : result = new SynonymFilter(result, new MySynonymEngine()); : result = new PorterStemFilter(result); : return result; : } : : The one I use for searching uses this: : : public TokenStream tokenStream(String fieldName, Reader reader) : { : TokenStream result = new StandardTokenizer(reader); : result = new StandardFilter(result); : result = new LowerCaseFilter(result); : result = new StopFilter(result, stopSet); : result = new PorterStemFilter(result); : return result; : } : : (Basically while searching I do not use the SynonymFilter.) : : I have quite a few products that I index that have the text on which I : am querying on. : : I do a search for this: ES-20D : : This is the final query that I run: : +(+content:es\-20d) +entity:product +(title:"es\-20d"~2^40.0 : ((title:es\-20d)^10.0) content:"es\-20d"~2^20.0 (content:es\-20d) : categoryName:"es\-20d"^80.0) : : (The content and title fields are Indexed, Tokenized and Stored. The : categoryName field is Indexed and Stored.) : : I get no hits? : : Where am i going wrong with this? Any pointers? : : -Thanks. : : : : : : --------------------------------------------------------------------- : To unsubscribe, e-mail: [EMAIL PROTECTED] : For additional commands, e-mail: [EMAIL PROTECTED] : -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]