6

I am having a problem doing wildcard searches in lucene syntax using the edismax handler. I have Solr 4.0 nightly build from the trunk.

A general search like 'computer' returns results but 'comer' doesn't return any results. Similary, a search like 'co?mput?r' returns no results. The only type of wildcard searches working currrently is ones with trailing wildcards(like compute? or comput).

I want to be able to do searches with wildcards at the beginning (puter) and in between (comer). Could someone please tell me what I am doing wrong and how to fix it.

Thanks.

Regards,
Imran.

2 Answers 2

5

Leading wildcard won't work unless you activate the reverse string filter. To use it in Solr, add a ReversedWildcardFilterFactory to the analyzer of the field that you want to search with a leading wildcard.

As for your other queries that return 0 result, try using luke to see how your terms are being analyzed (stored in the index). Don't forget to take into account the effect of stemming, if you are using it.

2
  • Thanks for your response. Could you tell me how to activate reverse String filter?
    – Imran Khan
    Jul 12, 2010 at 14:52
  • See my updates on how to use it in solr. Please tell us how it went, because I have never actually used it... Jul 12, 2010 at 15:17
0

With edismax, leading wildcards are no problem. I just retested it.

Wildcards in middle of term are no problem either.

Looks like there is something else wrong. Are you sure you are using edismax?

4
  • Thanks for responding. The edismax handler I am using is: drupal.org/files/issues/713142-solrconfig-1_0.patch I have Solr 4.0 nightly, and I'm querying the existing Index after setting QueryType as 'edismax'. Please could you point out what I am doing wrong? Thanks.
    – Imran Khan
    Jul 12, 2010 at 16:32
  • A bit hard to answer that, but how big is your war-file? My drupal war doesn't support edismax actually.
    – Jem
    Jul 12, 2010 at 17:11
  • I'm not using any war-file. I'm starting the Solr server via the jar (start.jar) and using SolrJ to Index and Search. While searching, I'm setting the QueryType as 'edismax'. Normal text searches work perfectly, only wildcards are not working. Any idea whats wrong?
    – Imran Khan
    Jul 12, 2010 at 17:21
  • Hey, I figured it out. I was using stemming. Got rid of that and it started working perfectly. Thanks for your help. :)
    – Imran Khan
    Jul 13, 2010 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.