Searching Attributes

Permalink
Hi there,

I have created a custom select attribute, added it to some of my pages, and given it a value. Under dashboard -> Pages and Themes -> Page Types -> Edit Page Attribute I have selected both of the check boxes under 'searchable'. However, searching for the value I have put in this attribute returns no results. I have also tried adding text to each of the meta attributes (title, description, keywords) and making them searchable, but again I get no results.

I have tried re-indexing, and clearing and disabling the cache.

The Basics : Search page (http://www.concrete5.org/documentation/general-topics/search/) seems to imply that this should be possible (near the bottom, under 'Including Page Attributes in search results'). In this forum post from last year the same issue is discussed, but no resolution is given.

Am I doing something wrong? Should I submit this as a bug report? I'm afraid I don't have much php experience, but is there anything else I can do to help?

[Edit]

Just a bit more info - the site I'm working on at the moment ishttp://support.oprius.com. There is a test page (creatively titled 'test') that has the following attributes:

Meta Title - test_meta_title
Meta Description - test_meta_description
Meta Keywords - test_meta_keys
Page Type - article

Page Type is a custom select attribute. All of these attributes have both searchable boxes checked. Interestingly, searching for the description ('test_description') returns the page.

 
JimboJetset replied on at Permalink Reply
JimboJetset
hi... linuxoid has just had me package up a free search_custom_attributes addon that might help. Use the link below to contact him.
http://www.concrete5.org/profile/-/21733/...
Fernandos replied on at Permalink Best Answer Reply
Fernandos
I'm sorry Jimbo, but I think that this guy won't ever answer him...

Anyway, Isaac you've done everything right.
It's not your error, the search block needs serious improvements and the core dev's know and work on it. I'm not sure if someone posted a patch to the search block in these forums yet. hmm, did you run the indexing job?


cheers
Fernandos
linuxoid replied on at Permalink Reply
linuxoid
I've sent him the whole custom attribute search package and told him what files he needs to hack as soon as I've checked my mail. But I can't help him to change it to suit his site though.

PS. I wonder what you meant by "but I think that this guy won't ever answer him" and why?
isaach replied on at Permalink Reply
Hi linuxoid,

I haven't received anything from you, either in my email account or as a message to my concrete5 account - where did you send it? My email address is ihavard@gmail.com. Do you think you could try sending it there? Sorry for the bother, and thanks for the help.

Cheers,
Isaac
linuxoid replied on at Permalink Reply 1 Attachment
linuxoid
I have replied to the email you've sent me. Or was it a PM from this forum? Could it be that if I replied to the PM through email it gets sent somewhere else?

Anyway, I've attached the package here just in case.

Now, it's a custom made search by attribute package which I use on my site. I'm not a C5 or PHP guru and it took me a month to get it to work the way I want. It's not perfect. But at least it's a start.

You will need to hack 3 files to make it work with your choices/attributes: view.php and controller.php in the Blocks folder and database_indexed_search.php in the Libraries folder.

Basically, I have 4 select boxes called Length, Continent, Adventure and Interest. You will need to change/add/delete all the relating code to suit your site. Of course, I also have pages with the same attributes.

Plus I filter all pages by Press Release type first before I filter by attribute. You can comment out that line if you want to filter from all content.

Sorry if I can't be of more help. I've submitted the package to Marketplace but it hasn't been approved yet. As it's a custom package I don't even know if it will be approved at all. But I'm not a programmer. It's up to C5 to decide. I hoped someone could take mine and improve it or make a generic package out of it.

Hope this helps.
isaach replied on at Permalink Reply
Hey Fernandos,

Yup, tried re-indexing. For now we're just going to put that kind of searchable meta-data in the description, since that is searchable at the moment, and use something else when displaying search results.

Either way, thanks for letting me know that this is a known issue. Nice to know I'm not just screwing something up!

Cheers,
Isaac
Fernandos replied on at Permalink Reply
Fernandos
You're welcome Isaac :)