I am using the default built-in search module on my site.

It is not able to search the actual content for example the text of a blog post, it is just indexing the title, or displaying results that have a title with the query text.

I would like it to search inside the body and a custom field I have created for my content.

I have tried to make my own search with Views, I created two exposed filters but then I have two text fields and the results must be shown on the same page. I would like to have a block and place it at the top of every page.

I was also thinking about modifying the search module code, but the search depends on the theme I am using the corperateclean theme.

What am I missing? This can't be this hard.


GreenSkunk’s picture

Hello CodyS,
You will find your solution by using the Search API

Note: In Drupal, it isn't good practice to hack Core or Core modules see Never hack core. The best practice is to override with your own module's code or theme's code.

"It is a damn poor day when you don't learn something!" - Mr. Jones, teacher

CodyS’s picture

So Search API is a development library, so I would also need a module or write my own.

None of the modules on that page seem to do what I need, (I tried all of the likely ones)

So that means that I need to use Search API to write my own module....

To search my site content....

This is a pretty standard task, that you would think would work out of the box, or at the very least someone would have made a module for it.

All I want to do is set the site search to search in the body field and another field. There should be a setting in the core search module for what to index and search.

GreenSkunk’s picture

I apologize as I thought you wanted to make a more advanced search. As soon as your content is indexed by a cron job you should be seeing matches in the site search results.
Do you have a cron job setup for the site on your hosting account?

When you are on the "content" tab of Search, you will be able to search for words appearing in the default rendering of node content on your site, which would include the default rendering of any CCK fields, Location fields, Taxonomy, etc., as well as comments.

From http://drupal.org/documentation/modules/search
Be sure to read the above documentation page.

"It is a damn poor day when you don't learn something!" - Mr. Jones, teacher

CodyS’s picture

It is not searching inside content. It only returns results that have the word I am searching for in the title.

If I search for a word which is in the body and not in the title the search will return no results

EDIT: OK I added comments and it is searching comments and the title