PMSEARCHTEXTQUERY(3)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMSEARCHTEXTQUERY πŸ’–

okay bestie, say hi to pmSearchTextQuery β€” she's the Library Functions Manual girlie who does full-text search for metrics, instances and instance domains that the PCP search services hand over. no cap, she's the one you call when you want to find stuff by vibes and words instead of by exact name. πŸ¦‹


✨ C SYNOPSIS ✨

like, literally just this:

#include <pcp/pmwebapi.h>

int pmSearchTextQuery(pmSearchSettings *settings,
                      pmSearchTextRequest *request, void *arg);

cc ... -lpcp_web

don't forget the -lpcp_web at link time or she simply will not show up. πŸ’…


🌸 DESCRIPTION 🌸

she runs a full-text search across name, oneline help and helptext (when it's actually available, no shade) β€” and exactly what she searches is whatever you put in request. here's the tea on every field, one by one, no skipping:

  • query β€” the query string that gets used to search. that's it, that's the whole vibe. πŸ”
  • count β€” limits how many results you get back. defaults to 10.
  • offset β€” the search offset. defaults to 0.
  • type_metric, type_indom, type_inst β€” bit flags that limit the query so it only takes specific types of entities into account. defaults to all.
  • highlight_name, highlight_oneline, highlight_helptext β€” bit flags saying whether or not to highlight the matched terms in the results. defaults to none. and when they are highlighted, the matched terms get wrapped in <b> and </b> β€” yes, actual HTML-ish tags, that's not a typo, that's the assignment. ✨
  • infields_name, infields_oneline, infields_helptext β€” bit flags that let you limit the full-text search query to only match against the fields you name. defaults to all.
  • return_name, return_indom, return_oneline, return_helptext, return_type β€” bit flags for omitting specific fields from the result. defaults to all. heads up though: fields may end up omitted either way if the value of that field just doesn't exist for a given record. not personal, bestie, the data's just not there. πŸ’€

and then β€” every single entity that matches the request above gets passed to the on_text_result callback that settings provides. she doesn't just find them, she hands them to you. main character behaviour honestly. πŸ‘‘


πŸŽ€ DIAGNOSTICS πŸŽ€

this function always returns zero on success. on failure, a negative PMAPI error code comes back at you. if you see a negative number, that's not a vibe, go read the code. 😭


🌈 SEE ALSO 🌈

go read these too, they're all in the group chat:


ngl this one is a bop: give her a request, get entities back through a callback, stay hydrated, and for the love of everything please check that return value. 🫢

Performance Co-Pilot β€” PCP, baybee. that's the source, that's the version, that's the whole page. mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from