I am trying to run a wildcard search, but I seem to be getting no
results.   I am using Lucene 2.1, and the SimpleAnalyzer.  

 

If I use the query parser, with the word "stainless", I get results (but
moving/changing the wildcard around does not do anything).

 

What am I missing?  Thanks!

 

 

For the following search strings:

 

SearchText = "stainless";

SearchText = "*stainless";

SearchText = "*tainless";

SearchText = "stainless*";

SearchText = "*stainless*";

 

String DefaultSearchField = "HighPriorityText";

QueryParser parser = new QueryParser(DefaultSearchField, MainAnalyzer);

parser.SetAllowLeadingWildcard(true);

Query MainQuery = new WildcardQuery(new Term(DefaultSearchField,
SearchText));

Hits Results = MainSearcher.Search(MainQuery);

 

System.Console.Out.WriteLine("Searching for: " + MainQuery.ToString());

System.Console.Out.WriteLine("Search Complete.  Result Count: " +
Results.Length().ToString());

 

============================================

Searching for: HighPriorityText:LanguageID: 1 AND (stainless)

Search Complete.  Result Count: 0

============================================

Searching for: HighPriorityText:LanguageID: 1 AND (*stainless)

Search Complete.  Result Count: 0

============================================

Searching for: HighPriorityText:LanguageID: 1 AND (*tainless)

Search Complete.  Result Count: 0

============================================

Searching for: HighPriorityText:LanguageID: 1 AND (stainless*)

Search Complete.  Result Count: 0

============================================

Searching for: HighPriorityText:LanguageID: 1 AND (*stainless*)

Search Complete.  Result Count: 0

 

 

=====================================

Douglas M. Smith

=====================================

Email: [EMAIL PROTECTED]

Yahoo: [EMAIL PROTECTED]

Jabber: [EMAIL PROTECTED]

=====================================

"For years there has been a theory that millions of monkeys typing at
random on millions of typewriters would reproduce the entire works of
Shakespeare. The Internet has proven this theory to be untrue."  -
Unknown

 

Reply via email to