Nishu,

first you should send this question to java-users not to general :)
When you index a doc the the content "mighty duck" your TokenStream
most likely builds two tokens t1:"mighty" t2:"duck"
the same happens (most likely) when you search for "mighty duck" with
the QueryParser so the query will be a boolean TermQuery("mighty") OR
TermQuery("duck"). This will retrieve your document. If you search for
"mightyduck" the query will only have one boolean clause (actually
none, its just a term query) with TermQuery("mightyduck"). Lucene will
not find any matches as this term is not in the index.

Hope that helps for understanding what is going on.

simon

On Tue, Nov 17, 2009 at 2:16 PM, Nishu Soni <[email protected]> wrote:
>
> Lucene is not throwing matches when search string is without space and data
> in my index file is with space.For e.g. if "Saddam Hussain" text is in index
> file and I am searchin "SaddamHussain", I am not getting any matches.I am
> using Boolean Query for scanning.
>
> Any help will be highly appreciated.
> --
> View this message in context: 
> http://old.nabble.com/Lucene-Not-Throwing-Matches-Without-Spaces-tp26389750p26389750.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
>

Reply via email to