Skip to content

PYL-35 support search by relationship - #24

Merged
lesaint merged 1 commit into
mainfrom
sebastienlesaint/pyl-35-search-persons-by-relationship-when-query-starts-with-a
May 22, 2024
Merged

PYL-35 support search by relationship#24
lesaint merged 1 commit into
mainfrom
sebastienlesaint/pyl-35-search-persons-by-relationship-when-query-starts-with-a

Conversation

@lesaint

@lesaintlesaint commented May 22, 2024

Copy link
Copy Markdown
Owner

WHY

A common use case of search is to try and find a person (or persons) by their relationship to others.

eg.:

  • parent de Peter
  • mère de Peter
  • ami de Peter

WHAT

  1. Search for the relationship that matches the query
  2. Search for the person on the right-hand side (from the alias perspective) that matches the name (here Peter)
  3. For the person (or persons) found, search for an occurrence of the relationship where the person is on the alias-right-hand side of the relationship
  4. Display the alias-left-hand-side persons

HOW

pylms search now supports either 1 word or 3 words

  • if 1 word, do the tag-based search as described in #PYL-34
  • if 3 words, do the new relationship search

pylms search parent de Peter

  • Find the relationship with an alias equal (case-insensitive) to the 2 first words
    • if no relationship is found, log (INFO) No match for "parent de Peter". and stop
  • Find one or more persons matching the 3rd word with the same method as for other commands
    • if no person is found, log INFO No match for "parent de Peter". and stop
  • Filter the persons to only those with the relationship and with standing on the right-hand-side (or the left-hand-side if the alias is reversed)
    • if no person is left, log INFO No match for "parent de Peter". and stop
  • Display the left-hand-side persons (or right-hand-side if the alias is reversed) of these relationships

pylms search père de Peter

  • same as above
  • but since the alias père de has sex defined for the left person, only display the left-hand-side person that has sex defined AND matches the one of the relationship alias

@lesaint
lesaintforce-pushed the sebastienlesaint/pyl-35-search-persons-by-relationship-when-query-starts-with-a branch from a889b78 to 9d522afCompareMay 22, 2024 10:25
@sonarqubecloud

Copy link
Copy Markdown

@lesaint
lesaint merged commit 91b0b80 into mainMay 22, 2024
@lesaint
lesaint deleted the sebastienlesaint/pyl-35-search-persons-by-relationship-when-query-starts-with-a branch May 22, 2024 10:29
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@lesaint