Hi, I was looking to create this for long time ago and I finally find a way. Seblod is so great that I want to return some to community. (Maybe my solution sucks and there is another easier way).
Main target: Make a text search field that to look in several other fields to match (for example meta keywords, meta description, fulltext, introtext and title)
You will need a very basics in mysql.
- Create a table in your database (jos_searchview) that will contain 2 columns (We're not going to duplicate data on the database, don't worry)
- id: This will have the article id of the content.
- combinedfields (or whatever): this will contain the data you are going to search in.
- Create a custom field called search_content_combined : Create a custom field called search_content_combined : This field have to store its data in the table we've just created.This field have to store its data in the table we've just created.t created.
- Give it a try in the admin form and see that the field store and the id. After this test remove the field from the admin form. You can skip this step if you feel confident.
- Delete (drop) the table you created in step 1.
- Create a "View" with the very same name and columns that the table you have just drop. Use concat in mysql to combine this fields.
FAST EX:
CREATE VIEW jos_searchview AS
SELECT id CONCAT('introtext', `fulltext`,
metakey,metadesc) as combinedfields FROM jos_content
WHERE published = 1
- Add the custom field to the search type and add the parameters as you like (exact, all words, any words, etc)
It is a view, so it will update by itself and you don't have to store/mantain the content twice.
I haven't test to do it directly with steps 5, 2 and 6 (in that order) but if seblod doesn't do something strange (like check the table is writable) I don't see why it can't works perfectly well.
Sure there is another way of doing this. Please let me know. If don't I am glad to help.