mattweber / solr-for-wordpress

A WordPress plugin that replaces the default WordPress search with Solr
85 stars 36 forks source link

Search post title? #46

Closed alxvallejo closed 12 years ago

alxvallejo commented 12 years ago

In the Wiki, you can specify the fields that you are searching for via this syntax:

q=superman&qf=title subject

But this doesn't seem to work in the Solr plugin. Also, the q parameter is replaced with an s in WordPress

mattweber commented 12 years ago

This is not a passthough to Solr, thus Solr specific query parameters are not supported. Behind the scenes, we craft a Solr query that searches across title, content, etc. If you need to do something special, you can change this behavior in your version of the plugin.

alxvallejo commented 12 years ago

You say the crafted Solr query searches across "title, content, etc" but it does not search across the title for me. Can you perhaps point me in the right direction? It's an excellent plugin that I doubt I would be able to recreate any time soon.

mattweber commented 12 years ago

It definitely searches title. Here is the part of the code that you are looking for:

https://github.com/mattweber/solr-for-wordpress/blob/master/solr-for-wordpress.php#L1004