getgrav / grav-plugin-relatedpages

Grav RelatedPages Plugin
http://getgrav.org
MIT License
17 stars 7 forks source link

Taxonomy to Taxonomy Matching gives wrong score, no results #8

Closed ganar closed 8 years ago

ganar commented 8 years ago

We are building a cooking site with recipes were we want a taxonomy to taxonomy relationship within the content. As I understand in the documentation, that would be that the score of a content related to the current page would be higher depending on the number of tags that match the tags of the page. Like so:

Chicken soup with potatoes

tags: chicken, potato, corn, milk, cheese, garlic

Mashed Potatoes

tags: potato, milk, olive oil, parsley, garlic

In this particular case, If we choose only to use the taxonomy to taxonomy option nothing will appear at the end of the Chicken soup with potatoes recipe, even though the score should be high enough, given the number of tags that match in this case and the configuration:

enabled: true
limit: 5
show_score: true
score_threshold: 1
filter:
  items: 
    @page: /contenidos
  order:
    by: date
    dir: desc
page_in_filter: false
explicit_pages:
  process: true
  score: 100
taxonomy_match:
  taxonomy: tag
  taxonomy_taxonomy:
    process: true
    score_scale:
      1: 50
      2: 75
      3: 100
  taxonomy_content:
    process: false
    score_scale:
      1: 20
      2: 30
      3: 40
      4: 60
      5: 70
      6: 80
      7: 90
      8: 100
content_match:
  process: false

If we set the taxonomy_content: process to true, then we get these results

scores

The last option,Colorido puré de papas— Spanish for the Mashed Potatoes recipe— should have a score of at least 100 instead of 8

What are we doing wrong in this case? The system seems to be having problem with the tag array: If I set it up to look for author or category, it works as it should.

rhukster commented 8 years ago

Can you please provide a sample of the markdown pages with their taxonomies set?

ganar commented 8 years ago

Sure @rhukster, here are the Colorido puré de papas

---
title: ' Colorido puré de papas'
published: true
header_image: '1'
header_image_file: pure.jpg
summary:
    enabled: '1'
    format: short
taxonomy:
    author:
        - 'Kristina Wetter'
    tag:
        - papa
        - 'Aceite de Oliva'
        - leche
        - perejil
    category:
        - 'Mis Recetas'
---

Este maravilloso puré de papas tiene el suave sabor del ajo al horno y el bellísimo color que le da el perejil.

===

and Chupe de Gallina

---
title: 'Chupe de gallina'
header_image: '1'
header_image_file: chupe.jpg
summary:
    enabled: '1'
    format: short
taxonomy:
    author:
        - 'Kristina Wetter'
    tag:
        - pollo
        - papa
        - maíz
        - leche
        - queso
        - cilantro
    category:
        - 'Mis Recetas'
---

El clásico chupe de gallina, perfecto para los fines de semana. Sírvelo bien caliente, con aguacate en cubos y un buen picante casero.

===
rhukster commented 8 years ago

I have fixed a bug with taxonomy->taxonomy matching that was causing count=0 every time. This is fixed in 1.1.4. This should show up in GPM in about an hour.

Please reopen this if it doesn't fix your issue.

ganar commented 8 years ago

Thanks a lot for the update @rhukster