Localsearch (formerly tracker 3)

Trying to add qmd files (this is a quarto file, an extension to markdown, and is plain text) so localsearch can do full text searches inside these files.

  1. Create two test files test-search.md and test-search.qmd both in the search path defined under Gnome-Search. These files are identical and look like this:
    Elephants are great!
    
  2. Use localsearch to look for elephants across my search folders: localsearch search elephant | grep -E '\.(md|qmd)$', and the test-search.md file is found but not the qmd.
  3. So I added a qmd mimetype like this in ~/.local/share/mime/packages/quarto.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
    <mime-type type="text/x-quarto">
    <comment>Quarto Document</comment>
    <sub-class-of type="text/plain"/>
    <glob pattern="*.qmd"/>
    </mime-type>
    </mime-info>
    
    and ran update-mime-database ~/.local/share/mime. Checking my test file using xdg-mime query filetype test_search.qmd yields test/quarto.
  4. Next I tested extraction using localsearch extract test_search.qmd and get this:
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix nao: <http://tracker.api.gnome.org/ontology/v3/nao#> .
    @prefix nrl: <http://tracker.api.gnome.org/ontology/v3/nrl#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix fts: <http://tracker.api.gnome.org/ontology/v3/fts#> .
    @prefix nmm: <http://tracker.api.gnome.org/ontology/v3/nmm#> .
    @prefix slo: <http://tracker.api.gnome.org/ontology/v3/slo#> .
    @prefix tracker: <http://tracker.api.gnome.org/ontology/v3/tracker#> .
    @prefix dc: <http://purl.org/dc/elements/1.1/> .
    @prefix nfo: <http://tracker.api.gnome.org/ontology/v3/nfo#> .
    @prefix osinfo: <http://tracker.api.gnome.org/ontology/v3/osinfo#> .
    @prefix nco: <http://tracker.api.gnome.org/ontology/v3/nco#> .
    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
    @prefix nie: <http://tracker.api.gnome.org/ontology/v3/nie#> .
    @prefix mfo: <http://tracker.api.gnome.org/ontology/v3/mfo#> .
    
    <file:///some/folder/in/gnome/search/path/test_search.qmd> nie:plainTextContent "Elephants are great!\n" ;
    rdf:type nfo:PlainTextDocument .
    
    which is more or less identical to the output when I extract on the markdown file.
  5. I added a custom extractor in ~/.local/share/tracker3/extractor-rules/99-quarto.rule containing this:
    [ExtractorRule]
    ModulePath=libextract-text.so 
    MimeTypes=text/quarto;
    FallbackRdfTypes=nfo:Document;nfo:PlainTextDocument;
    
    I couldn’t find any documentation on where localsearch looks for this and so I created a symlink in ~/.local/share/ called localsearch that links to the tracker3 folder.

No amount of resetting the index or restarting the systemd service, results in the new file types being searched.

Just added qmd to the dconf-editor tracker/extract/text-allowlist:

Even after a reindex, the qmd file isn’t being found while the md one is.