lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <>
Subject Re: Lucene Not Throwing Matches Without Spaces
Date Tue, 17 Nov 2009 16:09:25 GMT

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.


On Tue, Nov 17, 2009 at 2:16 PM, Nishu Soni <> 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:
> Sent from the Lucene - General mailing list archive at

View raw message