You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by L Duperval <du...@videotron.com> on 2010/08/10 21:40:31 UTC

Partial matching with spaces

I am using Compass which uses Lucene 2.4.1.

We are trying to implement "find as you type" searching. So for example, if I
have documents containing the following:

Newfoundland
New Mexico
New York
New Yorkshire

If a user types "New" all four documents are returned. When the user adds a
space, only the last three are returned. After typing "Y" the last two show up,
and so on.

It works, as long as there isn't a space in the query. Once there is a space,
nothing matches until the "k" in "New York" is added. And then, only "New York"
is returned, "New Yorkshire" isn't. 

Is there a way to do this with Lucene? If so, then I can try to make it work
similarly in Compass.

Thanks,

L


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org