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 Robert Young <bu...@gmail.com> on 2006/05/10 20:08:37 UTC

Searching across spaces

Hi,

How can I search accross spaces in the document when the spaces aren't
present in the search. For example, if the document contains
"spongebob squarepants" but the user searches on "sponge bob" I would
like to get the result.

Thanks
Rob

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


Re: Searching across spaces

Posted by Robert Young <bu...@gmail.com>.
Yes, I looked at the synonym sollution from Lucene in Action but, as
you point out, I have to know about it ahead of time. The only
sollution I've had so far is to index the term without the spaces as
well and then run two searches, one with spaces and one without. It
would work but it just seems like quite a ratty sollution.

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


Re: Searching across spaces

Posted by Erick Erickson <er...@gmail.com>.
I suspect you have to do some fancy indexing. That is, index the following
terms: sponge bob square pants spongebob squarepants.

But this requires that you understand all the variations you want to hit on
ahead of time.

Or, you could conceivably deal with wildcard queries, but I think this is
the same problem as indexing the many different terms.

Note that "Lucene in Action" has a section on indexing synonyms that could
be very helpful to you if you decide to index several terms, particularly if
you want span queries to operate in this space.

Best
Erick