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 Selvam Raman <se...@gmail.com> on 2017/12/15 10:37:04 UTC

Wildcard searches with special character gives zero result

Solr version - 6.4.0

"title_en":["Chip-seq"]

When i fired query like below

1) chip-seq
2) chi*

it is giving expected result, for this case one result.

But when i am searching with wildcard it produce zero result.
1) ch*p-seq


if i use escape character in '-' it creates two terms rather than single
term.

-- 
Selvam Raman
"லஞ்சம் தவிர்த்து நெஞ்சம் நிமிர்த்து"

Re: Wildcard searches with special character gives zero result

Posted by Michael Kuhlmann <ku...@solr.info>.
Solr does not analyze queries with wildcards in it. So, with ch*p-seq,
it will search for terms that start with ch and end with p-seq. Since
your indexer has analyzed all tokens before, only chip and seq are in
the index.

See
https://solr.pl/en/2010/12/20/wildcard-queries-and-how-solr-handles-them/
for example.

If you really need results for such queries, I suggest to have a
copyField which is unstemmed and only tokenized on whitespaces. If you
then detect a wildcard character in your query string, search on that
field instead of the others.

-Michael

Am 15.12.2017 um 11:59 schrieb Selvam Raman:
> I am using edismax query parser.
> 
> On Fri, Dec 15, 2017 at 10:37 AM, Selvam Raman <se...@gmail.com> wrote:
> 
>> Solr version - 6.4.0
>>
>> "title_en":["Chip-seq"]
>>
>> When i fired query like below
>>
>> 1) chip-seq
>> 2) chi*
>>
>> it is giving expected result, for this case one result.
>>
>> But when i am searching with wildcard it produce zero result.
>> 1) ch*p-seq
>>
>>
>> if i use escape character in '-' it creates two terms rather than single
>> term.
>>
>> --
>> Selvam Raman
>> "லஞ்சம் தவிர்த்து நெஞ்சம் நிமிர்த்து"
>>
> 
> 
> 


Re: Wildcard searches with special character gives zero result

Posted by Selvam Raman <se...@gmail.com>.
I am using edismax query parser.

On Fri, Dec 15, 2017 at 10:37 AM, Selvam Raman <se...@gmail.com> wrote:

> Solr version - 6.4.0
>
> "title_en":["Chip-seq"]
>
> When i fired query like below
>
> 1) chip-seq
> 2) chi*
>
> it is giving expected result, for this case one result.
>
> But when i am searching with wildcard it produce zero result.
> 1) ch*p-seq
>
>
> if i use escape character in '-' it creates two terms rather than single
> term.
>
> --
> Selvam Raman
> "லஞ்சம் தவிர்த்து நெஞ்சம் நிமிர்த்து"
>



-- 
Selvam Raman
"லஞ்சம் தவிர்த்து நெஞ்சம் நிமிர்த்து"