How to embed a search field from obsidian or omnisearch plugin into a note

With a key binding, I can insert below the YAML block multiple search queries with regular expressions.
I started out here, then finished up here.
No need to use Omnisearch (which doesn’t handle regex, either).

Then I have a Dashboard canvas (sort of like a home page) which shows 6 DataViewjs queries.
One of them queries the whole of my vault for files that have transcluded sections but missing the tag containstransclusions):

```dataviewjs
// Define the regular expression for embedded content
const regex = new RegExp("!\\[\\[.*?#\\^.*?\\]\\]", "gi")

// Query all my pages and crawl their raw data content
const pages = await Promise.all(
    dv.pages("")
	.filter(page => !page.file.etags.includes("#containstransclusions"))
    .map(async (page) => {
        const content = await dv.io.load(page.file.path);
        // Map pages to a custom object
        return {
            link: page.file.link,
            count: (content.match(regex) || []).length
        };
    })
)

// Render the result table
dv.table(
    [`Note`, `Missing tags`],
    pages
    .filter(p => p.count)
    .sort((a, b) => b.count - a.count)
    .map(p => [p.link, p.count])  
);
```
  • Anybody running this will have all their files with embedded material on display as probably nobody will have the same tag as me.