NixOS / nixos-search

Search NixOS packages and options
https://search.nixos.org
MIT License
422 stars 109 forks source link

FEATURE REQUEST: Filter - Maintained / Unmaintained #812

Open Malix-Labs opened 4 months ago

Malix-Labs commented 4 months ago

Feature Request

A filter for maintained / unmaintained elements

pinpox commented 3 months ago

I stumbled across this query by @garbas and @infinisil to search for unmaintained packages https://github.com/NixOS/rfcs/pull/81#issuecomment-803182812

However it seems to not work on the current search API. Does anyone know how to update it to the current version? I'm trying to compile a list of unmaintained packages.

I tried searching using:

{
   "from":0,
   "size":50,
   "sort":[
      {
         "_score":"desc",
         "package_attr_name":"desc",
         "package_pversion":"desc"
      }
   ],
   "query":{
      "bool":{
         "filter":[
            {
               "term":{
                  "type":{
                     "value":"package",
                     "_name":"filter_packages"
                  }
               }
            }
         ],
         "must":[
            {
               "term":{
                  "package_maintainers_set":{
                     "value":"No maintainers"
                  }
               }
            }
         ]
      }
   }
}

And:

 curl 'https://search.nixos.org/backend/latest-42-nixos-24.05/_search' \
  -H 'Authorization: Basic YVdWU0FMWHBadjpYOGdQSG56TDUyd0ZFZWt1eHNmUTljU2g=' \
  -H 'Content-Type: application/json' \
  -H 'Pragma: no-cache' \
  -H 'Cache-Control: no-cache' \
  --data @query.json | jq

But that returns 0 hits. Maybe someone with more knowledge of the search syntax can spot the error in the query?

infinisil commented 3 months ago

Oh damn, I don't even remember writing this anymore, sorry I can't help much :sweat_smile: