wildcards with SpanQuery

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

wildcards with SpanQuery

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?

Thanks,
Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: wildcards with SpanQuery

Karl Wettin-3

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: wildcards with SpanQuery

Erik Hatcher
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: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]