Hello.
As I know I can use wildcard * in search. But it seems it doesn't work. Why?
For example I have node with the title Lorem Ipsum. If I enter Lorem or Ipsum, I will get it. But I don't get this result entering Lor or Lor*.

Comments

nick_vh’s picture

Status: Active » Closed (works as designed)

Please search the issue queue. You need edismax for that and since that is only available in Solr 3.x it is not supported by default in the module. Tae a look at the acquia search module how to enable it

Thanks for being so active in the Solr Space ;-)

Georgique’s picture

Thanks a lot for you support.
One little question - installing Solr 3.x would not help me?

Georgique’s picture

Replaced Solr 1.4.x with 3.5.0, now replaced schema and solrconfig, just cannot find information about what to do else. Dismax is enabled in solrconfig.xml.

damien_vancouver’s picture

Here's a summary of the steps to get wildcard search working with ApacheSolr search integration. It's actually just 4 simple steps. See #1539284: Wildcard search using eDisMax handler with Solr 3.x for more information.

1. When installing the module, download and install Solr 3.5.0 (3.6.0 might work too). As noted in the module's installation instructions, use the Solr 3.x versions of schema.xml and solrconfig.xml when setting up your Solr server.

2. After the module is installed you need to set a solr environment variable. You can do this from a custom module with the code:

  apachesolr_environment_variable_set('solr','apachesolr_query_type', 'edismax');

which you just need to run once on your site database, not every page load or anything. I ran it out of a simple page callback handler in a custom module. It could really use drush-ifying at some point :)

3. Now you should be using the "edismax" query handler which supports wildcards. You can use * in search terms.

4. Search terms must be lower case if you're using wildcards. So you probably want to convert search terms to lower case somehow (I explain one way in #1539284).

nick_vh’s picture

It could help that they fixed this in Solr 3.6 ;-)

http://wiki.apache.org/solr/Solr3.6

Many analyzer factories are now "multi term query aware" allowing for things
like field type aware lowercasing when building prefix & wildcard queries.
(SOLR-2438)

Georgique’s picture

@damien_vancouver
Yes, thanks, those issue was mine too =))
Now everything works good

damien_vancouver’s picture

@nick_vh,

that's good news about solr 3.6.0! I will give that a try... I opted for 3.5.0 to be sure it would work with the module. I will try out 3.6.0 and report back here.

Georgique’s picture

I installed Solr 3.6.0, wildcard search works regardless of upper or lower cases.

acbramley’s picture

@damien_vancouver thank you very much, just needed that PHP snippet to enable.