You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jeff Schmidt <ja...@535consulting.com> on 2012/04/27 21:12:59 UTC

Disabling, escaping, or re-assigning '*' wildcard character (edismax)

Hello:

In my application domain, there is something known as a microRNA star strand, which contains '*' as a character.  For example: hsa-let-7a-2*, which is distinct from hsa-let-7a-2.

I'm using edismax to handle queries. I need to treat '*' just like any other punctuation character.  Is that possible with edismax?  Or would have I have to revert to dismax?

Thanks,

Jeff
--
Jeff Schmidt
535 Consulting
jas@535consulting.com
http://www.535consulting.com
(650) 423-1068










Re: Disabling, escaping, or re-assigning '*' wildcard character (edismax)

Posted by Jeff Schmidt <ja...@535consulting.com>.
Martijn:

What you describe sounds like a great approach to solving my problem.  If I cannot get edismax to ignore it, then escape it to accomplish the same thing.

I'll give that a try.

Thanks!

Jeff

On Apr 27, 2012, at 2:43 PM, Martijn van Groningen wrote:

> Hi Jeff,
> 
> Another option is to use the Lucene escape character: '\'
> Escaping is described here:
> http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/queryparsersyntax.html#Escaping
> Special Characters
> 
> If you're using SolrJ you can use the ClientUtils#escapeQueryChars(),
> this would escape the whole query (not only the * character).
> Hope it helps.
> 
> Martijn
> 
> On 27 April 2012 21:12, Jeff Schmidt <ja...@535consulting.com> wrote:
>> Hello:
>> 
>> In my application domain, there is something known as a microRNA star strand, which contains '*' as a character.  For example: hsa-let-7a-2*, which is distinct from hsa-let-7a-2.
>> 
>> I'm using edismax to handle queries. I need to treat '*' just like any other punctuation character.  Is that possible with edismax?  Or would have I have to revert to dismax?
>> 
>> Thanks,
>> 
>> Jeff
>> --
>> Jeff Schmidt
>> 535 Consulting
>> jas@535consulting.com
>> http://www.535consulting.com
>> (650) 423-1068
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> -- 
> Met vriendelijke groet,
> 
> Martijn van Groningen



--
Jeff Schmidt
535 Consulting
jas@535consulting.com
http://www.535consulting.com
(650) 423-1068










Re: Disabling, escaping, or re-assigning '*' wildcard character (edismax)

Posted by Martijn van Groningen <ma...@gmail.com>.
Hi Jeff,

Another option is to use the Lucene escape character: '\'
Escaping is described here:
http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/queryparsersyntax.html#Escaping
Special Characters

If you're using SolrJ you can use the ClientUtils#escapeQueryChars(),
this would escape the whole query (not only the * character).
Hope it helps.

Martijn

On 27 April 2012 21:12, Jeff Schmidt <ja...@535consulting.com> wrote:
> Hello:
>
> In my application domain, there is something known as a microRNA star strand, which contains '*' as a character.  For example: hsa-let-7a-2*, which is distinct from hsa-let-7a-2.
>
> I'm using edismax to handle queries. I need to treat '*' just like any other punctuation character.  Is that possible with edismax?  Or would have I have to revert to dismax?
>
> Thanks,
>
> Jeff
> --
> Jeff Schmidt
> 535 Consulting
> jas@535consulting.com
> http://www.535consulting.com
> (650) 423-1068
>
>
>
>
>
>
>
>
>

-- 
Met vriendelijke groet,

Martijn van Groningen