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 Michael Dodson <mg...@mac.com> on 2006/04/18 20:10:43 UTC

wildcards with SpanQuery

Is it possible to use wildcards with SpanNearQuery?

For example, if the user enters "fast car" with a slop of 1 things  
like "fast cars" "faster cars" "fast brown cars" etc would be found?

Thanks,
Mike 

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


Re: wildcards with SpanQuery

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
There isn't a SpanWildcardQuery, per se, but there is a SpanRegexQuery:

	<http://svn.apache.org/repos/asf/lucene/java/trunk/contrib/regex/src/ 
java/org/apache/lucene/search/regex/>

It can be used to achieve the same sort of thing, only using standard  
regex syntax like fast.* (instead of fast*)

But, stemming should be considered as well.  It'd certainly be more  
performant using a regular PhraseQuery with terms analyzed and  
stemmed, matching terms analyzed the same way during indexing.

	Erik


On Apr 18, 2006, at 2:33 PM, karl wettin wrote:

>
> 18 apr 2006 kl. 20.10 skrev Michael Dodson:
>
>> Is it possible to use wildcards with SpanNearQuery?
>>
>> For example, if the user enters "fast car" with a slop of 1 things  
>> like "fast cars" "faster cars" "fast brown cars" etc would be found?
>
> You might be looking for stem-analysis? You can, for instance, take  
> a look at the snowball stemmers.
>
> Wildcards would be if the user enters 'fast* car'.
>
> But to answer your question, there is no SpanWildcardQuery as far  
> as I know. You could make one though. And I can imagine it would,  
> just as SpanFuzzyQuery, be really slow and virtually unusable in  
> the hand of the users.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


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


Re: wildcards with SpanQuery

Posted by karl wettin <ka...@snigel.net>.
18 apr 2006 kl. 20.10 skrev Michael Dodson:

> Is it possible to use wildcards with SpanNearQuery?
>
> For example, if the user enters "fast car" with a slop of 1 things  
> like "fast cars" "faster cars" "fast brown cars" etc would be found?

You might be looking for stem-analysis? You can, for instance, take a  
look at the snowball stemmers.

Wildcards would be if the user enters 'fast* car'.

But to answer your question, there is no SpanWildcardQuery as far as  
I know. You could make one though. And I can imagine it would, just  
as SpanFuzzyQuery, be really slow and virtually unusable in the hand  
of the users.

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