1971 Posts in 1275 Topics by 607 members
Page: 1 2
|Go to End||Next >|
14 November 2011 at 12:55pm Last edited: 14 November 2011 12:55pm
I’m getting crazy: in the FulltextSearchable class, it’s clearly stated that we can use…
…for something as simple as adding two custom fields of a custom page extending the Page class (here, from the common Simplestripe theme).
But the index for those fields is never being added to the data base, as the only classes allowed are SiteTree and File.
Does it means that the documentation of the FulltextSearchable class is wrong and the whole functionality is half-baked? Should I implement a custom search for extended pages?
Thanks in advance,
25 November 2011 at 9:54pm
So Object::add_extension('HomePage',"FulltextSearchable('HomeCol1,HomeCol2')"); isn't adding the indexes? You should still be able to add the decorator manually. Fulltextsearchable::enable() is restricted to SiteTree and file but I don't think that limits the use of the extension on other records.
29 November 2011 at 3:37am
No, no indexes, that’s why I’m asking here: it seems that there is an error somewhere on the FullTextSearchable code… but I have not been able to debug it. I really need to extend the Search to custom fields for a current project, I don’t know what else to do, bu well I’ll keep trying!
10 January 2012 at 8:56am Last edited: 10 January 2012 8:57am
I am having the extact same problem. But i might add this.
In that line below, where Nom, Prenom eand Entreprise are custom textFields
Object::add_extension('MyObject', "FulltextSearchable('Nom','Prenom', 'Entreprise')");
What is 'MyObject' refers to?
I tried Page, no change.
I tried HomePage, error.
I tried MemberPage (name of the page where customs fields ae added), no change i.e. no results found from customs textFields..
10 January 2012 at 1:33pm
I finished using this old hack:
It works, at least here.
Hope it helps,
10 January 2012 at 1:54pm
Hi Juanito, funny i learned that i am gonna spend a month in France next summer: either Montpellier or Les Herbiers. Long way from Canada!
- - -
Back to the thread: on the link you provided, do i start from page 1 or solution is a the section/page you highligted?
Better, give me a hint on how to solve this?
10 January 2012 at 9:44pm
I wish you a nice séjour in France.
I used the solution posted by Aram. Get the ZIP file, install the module custom_search and use the example provided in a folder sibling folder to understand how does it work. Don’t forget to provide your DataObjects with Link, Title and canView functions, or you’ll see nothing in the search results.
A side note: This didn’t worked for me with a has_many object, I couldn’t get Links and Titles for it in the search results, so I had to change it to a many_many. I don’t know if there is a problem with the code or, more probably, if I overlooked something in my code. I’m not a good programmer.
Hope it helps,
11 January 2012 at 12:31am
Bonjour Juan, je ferai de mon mieux!
- - -
Ill try custom_search. But ive read on another posts that one could possibly have SS search thru customs textfields by populating $Metatags and $Description with its content. As those later two are looked over by the standard search engine, it supposely works.
Back to my AS3 days, it would like this.
var $Metatags.text = $Nom.text + $Prenom.text + $Entreprise.text
where the later three are my custom textfields.
Page: 1 2
|Go to Top||Next >|