It seems like what I should we using is something more like a SimpleAnalyzer or StopAnalyzer.
I've changed my code and the query to use SimpleAnalyzer. But now i have another question. Let's say I have 'return_results.pl' in the document in one of the fields. When I search for return_res* or return_res~ it won't return the document. But searching for any of these does return the document: 1. 'return_results' 2. 'results' or 'return' 3. 'results.pl' 4. 'results~' 5. 'return_results~' I guess I have to read more about the '*' and '~'? -----Original Message----- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 4:58 AM To: Lucene Users List Subject: Re: Search Question - not returning desired results On Tuesday, November 25, 2003, at 12:11 PM, Pleasant, Tracy wrote: > > The documents I have index contain information regarding file names > also. > > For instance 'return_results.pl' or something like that may be in the > document fields. > > I am not understanding Lucene's way of searching: > > 1. If I search for 'return_results', the search does not return > anything > 2. If I search for 'results' or 'return', the search does not return > anything > 3. If I search for 'results.pl', the search does return the document > containg 'return_results.pl' > 4. If I search for 'results~', the search does return the document > containg 'return_results.pl' > 5. If I search for 'return_results~', the search does not return > anything > > What is going on? > > I want it to return the document in all of the situations. > > I also don't want to have to use '~' all the time. We sure do have a recurring theme lately :) Analysis! Please refer to my article at java.net: http://today.java.net/pub/a/today/2003/07/30/LuceneIntro.html Look at the AnalysisDemo code. Copy it over and try it out on the text you're using and the Analyzer you're using. The bracketed text that comes out are the "tokens" that you can search on. It is very very important to understand this process and to really know what terms come out of text you hand it - otherwise it is a mystery why some things can be found and some things cannot despite your expectations to the contrary. A follow-up to the Analysis is querying - and QueryParser has it's own set of quirks and caveats related to how things are tokenized/analyzed. And, I've got just the follow-up article for you handy... http://today.java.net/pub/a/today/2003/11/07/QueryParserRules.html If you digest both of these articles (analysis one first please) then I think a lot of questions that get asked on this list will be implicitly answered. Understanding analysis is key. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
