Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better relevancy while searching #37

Open
filak opened this issue Nov 15, 2023 · 4 comments
Open

Better relevancy while searching #37

filak opened this issue Nov 15, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@filak
Copy link
Owner

filak commented Nov 15, 2023

Try to use propLists

https://jena.apache.org/documentation/query/text-query.html#lists-of-indexed-properties

text:propLists (
    [ text:propListProp mesht:defQuery ;
      text:props ( 
         rdfs:label
         meshv:identifier 
         meshv:prefLabel
         meshv:altLabel
         meshv:casn1_label
         meshv:registryNumber
         meshv:relatedRegistryNumber
             mesht:identifier 
             mesht:prefLabel
             mesht:altLabel
             mesht:casn1_label
          ) ;
    ]
    [ text:propListProp mesht:includeNotes ;
      text:props ( 
         rdfs:label
         meshv:identifier 
         meshv:prefLabel
         meshv:altLabel
         meshv:casn1_label
         meshv:registryNumber
         meshv:relatedRegistryNumber
             mesht:identifier 
             mesht:prefLabel
             mesht:altLabel
             mesht:casn1_label
                mesht:translatorsNote
                mesht:annotation
                mesht:historyNote
                mesht:scopeNote
          meshv:annotation
          meshv:historyNote
          meshv:note
          meshv:onlineNote
          meshv:publicMeSHNote
          meshv:scopeNote
         ) ;
    ]
) ;

Add filter - checkbox - to the form (searchForm)

  • includeNotes
{% set prop_list = 'mesht:defQuery' %}
{% if includeNotes == 'yes' %}
    {% set prop_list = 'mesht:includeNotes' %}
{% endif %}

  {% if slang == 'target' %}
    (?s ?score) text:query ({{ prop_list }} "{{ query }}" 500 "lang:{{ lang }}") .
  {% elif slang == 'source' %}
    (?s ?score) text:query ({{ prop_list }} "{{ query }}" 500 "lang:en") .
  {% else %}
    (?s ?score) text:query ({{ prop_list }} "{{ query }}" 500) .
  {% endif %}
...
@filak filak self-assigned this Nov 15, 2023
@filak filak added the question Further information is requested label Nov 15, 2023
@filak
Copy link
Owner Author

filak commented Nov 16, 2023

propLists not working as expected - more testing is needed...

There are some issues with Jena

@filak filak changed the title Better relevancy with searching - text queries Better relevancy while searching Nov 16, 2023
@filak filak added enhancement New feature or request and removed question Further information is requested labels Jan 18, 2024
@filak
Copy link
Owner Author

filak commented Jan 18, 2024

Waiting for this to be merged apache/jena#2121 - Done!

@filak
Copy link
Owner Author

filak commented Feb 19, 2024

Lets wait for the 5.0 Apache Jena release...

@filak
Copy link
Owner Author

filak commented May 14, 2024

Apache Jena 5.0 released

To be done in MTW version 1.7.0 - Jena must be upgraded - possible breaking change

@filak filak added the priority label May 14, 2024
@filak filak removed the priority label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant