Expanded Functionality For Similar Module To Look Inside Other Fields
| Project: | Similar Entries |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
In the READ ME file for the similar entries module it states that:
A module that displays a block with similar published nodes to the currently viewed one, based on the title and body fields.
I feel that the similar module would be more useful if this were expanded to say something like:
A module that displays a block with similar published nodes to the currently viewed one, based on the title and body fields or any other custom field your select.
In other words:
In the Similar modules current state it works great for finding similar articles when all relevant words are actually contained within the article's body. However there are other types of content where all relevant themes/words will not be included. Off the top of my head, poems and photos come to mind.
What I propose is that similar.module allows you to select what fields to search inside of. Say for example, that your site requires the posting of poems or photos, you could then create a Content Type of Poems and give a text field for the poem its self and another text field for keywords.
Then under the Similar modules settings you would be able to configure each content type. You could then click to configure your “Poems” content type where you would be presented a list of the fields within that content type and be able to check which fields the Similar Entries Module would look inside.
Say for example you have a content type for Photos and you have a field for keywords. You may have a photo of a house being built, and another of a house burning down. Similar would have no way to know that these two photos are both of houses and therefor could not link them. If you had keywords for the photo however it could. You could also go further and have a field for what camera the photo was taken with, etc.
What I suggest would look something like this:
For a visual example I am attaching an image of what the Configuration section of the mod could look like. In the image Photos and Poems are Content Types and (Photo Body, Keywords, Camera, Location) & (Poem Body, Keywords, Mood) are text fields within these custom content types.
| Attachment | Size |
|---|---|
| similar.gif | 4.03 KB |

#1
I have no idea what that screenshot is from, so I'm guessing it's a mockup of some sort. If you use the node types and taxonomy filter, I think you'll get close to what you're talking about, but I give a -1 to a keyword field when no matches in a MATCH() in MySQL will default to showing similar taxonomy nodes.
Do you have perhaps another example of a way to implement this feature request?
#2
Thank you for taking the time to look over my feature request and yes, you are correct, the image I attached is simple an HTML mock up that I made to put my idea in a visual format.
I am not entirely sure what you are asking when you say “Do you have perhaps another example of a way to implement this feature request?” because I am by no means a PHP expert so I will do my best to explain and am sorry if this is not what you were asking.
Basically what I was suggesting was that users would be able to select what text fields (fields that would be created using CCK when making a new Content Type), within a specific content type, Similar Entries would look in when finding similar nodes. Therefor, based on the picture I attached a user could, if they wanted to:
For Content Type Photos:
Under “Taxonomy category filter”they could select “Only show the similar nodes in the same category as the original node” and then check only the Location box (from the image I attached where Location is a text field in the Content Type Photos) so that Similar Entries only shows picture similar to the current picture based on location. They could also show similar pictures by which camera was used or by keywords assigned to the photo.
(ex. If the site visitor was viewing a picture with a location of “New York City, NY” similar may also show links to picture of “Oklahoma City, OK” and “Albany, NY” or... If keywords were selected instead of location and the picture had keywords like “industrial”, “factory”and “rundown” similar.module would be able to show picture from other “rundown” areas as well as other factories or industrial areas.) BTW, I am not implying any of the above locations are rundown.
For Content Type Poems:
A user could use the same “Taxonomy category filter” settings and then for the Content Type of POEMS they could chose to not have the similar mod search in the body of the actual poem itself but rather only in the keywords or mood. This way similar.module would be able to show a list of poems that were written while the writer was in a similar mood.
(ex. When reading a happy poem, other poems with "happy" also listed under mood would be shown.)
By selecting for similar to look only under “Mood” for similar entries the entire body of the poem can be ignored and therefor find matches that are more specific.
As I said, I am not a programmer and would not know how to, through PHP and MySQL, implement this but after reading through the forums while trying to find a way to show related nodes based on keyword alone I saw that other people were looking for this also and decided to give my opinion on the most flexible way to do this and similar.module seemed the closest thing there was so far.
Finally I am unsure what you mean by “I give a -1 to a keyword field when no matches in a MATCH() in MySQL” as I am unfamiliar with all the workings of MySQL so I am sorry if I missed something while answering. Are you saying the module can already look in other fields and if so can it be told to not look in certain fields at all on a per content type basis. If so sorry for the request.
Thank you for your quick reply and sorry if I misinterpreted your question.
#3
I'll re-open this, and though I think you can do what you're asking with the module as it is now.
The way I've gotten around the picture example is by putting photos in the image module's gallery. By sorting them in galleries and adding a taxonomy, the similar module is able to search within the gallery (which is a taxonomy) and the category (not necessarily image gallery related). The poems, I would tag with a mood taxonomy. Then if you use the taxonomy limiter, it would only get similar node body content in the same mood taxonomy, which is better IMO than removing the body from the similar matching in favor of mood keywords.
#4
I think this functionality needs to be added to make Similar Entries a useful extension. Its far too limited in only being able to use the title and body tags, especially when created node types don't have a body.
I would love to use Similar Entries, but it is currently useless to me because of its lack of support for CCK nodes, which is very dissapointing.
#5
Subscribing, support of taxonomy terms similarity would be great also!
greetings, Martijn