Hi bucefal91
Regarding new Synonyms' search (include synonym fields into search index) option which will be implemented with latest module rewrite...
I have searched drupal module database and I have discovered Term Search module which has very similar functionality already.
It looks nicely maintained, and as I can see in it's documentation it enables Vocabulary fields "include to search index" functionality through Vocabulary display settings. Very nice and flexible "Drupal 7 way" to do it.
It seems to me that Synonyms module search functionality can be achieved by enabling Term Search module and adding synonyms enabled fields to search index through Vocabulary display options as explained in Term Search module documentation.
It is also mentioned in Term Search module documentation that it has hooks so that other modules can utilize it's functionality.
So, the question is what is better - to have Synonyms' own search functionality so that Synonyms is less dependant on other modules - or to simplyfy Synonyms code by removing completely Synonyms' search functionality and to add a note to Synonyms module documentation about Term Search module existing (for those who need Synonyms search functionality).
I vote for second sollution.
However, if removing completely search box from Synonyms module is radical and you would like to make it easier for Synonyms audience to include Synonyms fields into search index - maybe it is good idea to create little "Synonyms Search" submodule (depandant on Term Search module) which hooks into Term Search to add search checkboxes at Vocabulary Synonyms setting form. So that Synonyms module itself do not become dependant on Term Search module - just it's "Synonyms Search" submodule. If hooks available by Term Search module are flexible enough for such hooking of course.
Sorry bucefal91. I know that you would like to reliese v1.3 soon... and I'm just adding a bunch of new request and improvement issues these days. :)
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 2580015-term-search-integration-12.patch | 42.84 KB | bucefal91 |
| #9 | 2580015-term-search-integration-9.patch | 42.84 KB | bucefal91 |
Comments
Comment #2
devad commentedComment #3
devad commentedComment #4
devad commentedHmmmm.
I have tested rewritten synonyms module in cooperation with Term Search module.
Term Search module has nice and clean drupal friendly mood.
It adds new "Search index" Display setting to Vocabulary's "Manage display" page and enables it by default.
It also enables all Vocabulary fields to participate in Search index by default. Each field can be hidden from Search index of course by moving to "Hidden" section.
For test purpose I have added field Synonym and enabled it as synonym field at Tags vocabulary settings page.
I have also added one term into tags vocabulary: Name: term1; Synonym: synonym1
Searching terms works. If I search terms by synonym name "synonym1" it displays "term1" in search results. That's nice. Synonyms module doesn't have such functionality I think. It would be a nice addition to be able to search terms by it's synonym value.
However, If I search Nodes by synonym value "synonym1" it does not display nodes with term reference field containing term "term1" in search results. So, Field Search module has done some job, but there will be some custom coding as well if we want to use it for Synonyms' search functionality.
Therefore, removing Synonyms search functionality completely and depending for search functionality on Term Search module only is not an option any more.
But creating "Synonyms Search" submodule which utilize Term Search functionality and adds some of it's own custom code to acomplish synonyms search on nodes... is still an option.
And, who knows... maybe feature request could be requested to Term Search module maintainer for new feature to be included into Term Search module. If he gets some help from you (and I can make some tests) in the form of tested patch ready to be commited he will not have any objections to implement such a feature... probably. :)
Comment #5
bucefal91 commentedHello!
Actually these 2 "search integrations" are different.
Synonyms module integrates into Search core module in such a way, that nodes with taxonomy term reference field can be found when searching for synonyms of the taxonomy terms they reference - that's why you were able to find nodes, when searched for "synonym1" with Synonyms module.
Then, coming from the project description of Term Search, they do a different thing - they let taxonomy terms to be found by the values of their fields. That's why you were able to find a term, when searched for "synonym1".
What I would do is the following: I would integrate Synonyms and Term Search, so that the taxonomy terms can be found when searched for one of their synonyms. It will not require modifications in Term Search module (at least I have this feeling after reading their project description).
Comment #6
devad commentedI understand that these two modules search implementations are completely different currently. And that using Term Search as a base for Synonyms node search would require a complete rewrite of Synonyms node search functionality.
It just seems to me that Term Search module could be used as a base for Synonyms node search functionality because it is done nicely and flexible. So, maybe its term search (by synonyms) functionality can be easily expanded (one step further) to cover node search (by synonyms) usecase. But, how complex would it be to write such "Synonyms Search" (node search) submodule (based and dependant on Term Search) I don't know. :)
It would be nice to remove completely Synonyms current node search functionality - less code to design, maintain, support and bugfix in the future.
But if it's too complicate to do rewrite and make "Synonyms Search" nodes search submodule as described above - we can keep current Synonyms node search functionality of course.
Comment #7
devad commentedYes, it would be nice new feature covered by Synonyms module (Term search by synonym).
It could be done by just referencing Term Search module in documentation - without any coding at all.
But if you would like to make tighter, automatic functionality connection - that would be even better. :)
Comment #8
bucefal91 commentedYes, I prefer automation, so people have less pain to worry about. I'll code it. I do not think it will be complicated.
Comment #9
bucefal91 commentedHello, devad!
Again, some thing got rewritten in this patch. Now there's "Synonyms Search" submodule within Synonyms module. It carries out all search integration. Out of the box, after being enabled it provides integration with searching nodes (the nodes can be found by synonyms of terms they reference).
Then, if the Term Search module is enabled in the Drupal instance, then Synonyms Search also integrates with it too, in such a way that terms can be found by their synonyms.
Would you mind to have a look at it and test it out?
Comment #10
devad commentedTested patch #9.
Nice. :)
It works just as you have described.
Comment #11
devad commentedOne documentation correction:
This quote is from #9 patch:
Correct name of module is "Term Search" - not "Taxonomy Search".
Taxonomy Search module exists as well - but it is developed for D5 only.
If there are some more "Taxonomy Search" phrases used in visible documentation lines instead of "Term Search" they should be replaced as well.
Comment #12
bucefal91 commentedRight, thank you! I am always bad about specific terms and being precise in the documentation/instructions. The only place where I found it was the place that you mentioned.
There's no real need to test the patch, as the code hasn't changed. In a few days I'll have it committed into the development snapshot if nobody else speaks up in the issue.
Thanks a lot, devad! The module has enormously benefited since you showed up.
Comment #14
bucefal91 commentedWe got this thing committed :) Thank you, devad!