I thought my question might be confusing...

I know about Solr providing wildcards in queries, but my problem is different.

I have those patterns associated with my searchable documents before any actual 
search is done.
I need Solr to return the document which is associated with matching patterns. 
User does not enter the wildcard pattern; wildcard pattern must be tested by 
Solr automatically.

So in the example I provided below, a user might enter " ABCDXYZ " and I need 
Solr to return Doc1, as Doc1 has the pattern "AB%CD%" associated with it 
(somehow?!).

Thanks,
Alexander


-----Ursprüngliche Nachricht-----
Von: Ahmet Arslan [mailto:iori...@yahoo.com] 
Gesendet: Freitag, 10. August 2012 10:34
An: solr-user@lucene.apache.org
Betreff: Re: Indexing wildcard patterns



--- On Fri, 8/10/12, Lochschmied, Alexander <alexander.lochschm...@vishay.com> 
wrote:

> From: Lochschmied, Alexander <alexander.lochschm...@vishay.com>
> Subject: Indexing wildcard patterns
> To: "solr-user@lucene.apache.org" <solr-user@lucene.apache.org>
> Date: Friday, August 10, 2012, 11:07 AM Coming from a SQL database 
> based search system, we already have a set of defined patterns 
> associated with our searchable documents.
> 
> % matches no or any number of characters _ matches one character
> 
> Example:
> Doc 1: 'AB%CD', 'AB%CD%'
> Doc 2: 'AB_CD'
> ...
> 
> Thus Doc 1 matches
> ABXYZCD
> ABCD
> ABCDXYZ
> ...
> 
> Whereas Doc 2 matches only
> ABXCD
> ABYCD
> ABZCD
> ...
> 
> This can be achieved in SQL WHERE statements using the LIKE operator.
> 
> Is there a (similar) way to this in Solr?

Yes, wildcard search in solr

* matches no or any number of characters ? matches one character

 http://lucene.apache.org/core/3_6_0/queryparsersyntax.html#Wildcard%20Searches

Reply via email to