decoupling Search 👀 Query Builder from WebPart Properties and running it with JavaScript

Iron Contributor

I spent some time googling around .. no luck

 

#Goal

Am building me own flavor of the Content Search WebPart, it performs REST Searches [✔], transforms the results [✔], and displays everything in an Angular SPA [✔]

(I am steering away from DisplayTemplates, which are a pain to build and maintain)

I now want to present the user with a nice QueryBuilder [?]

would like to use SharePoints own Search Query Builder without using the WebPart Properties UI

 

#Analysis

The (REST) Search Query Builder

 

Can be started with:

Search.Configuration.QueryBuilder.launchQueryBuilder(
    "...[path to aspx page]..",
    "{bd690c55-070e-417d-9845-db531a89ef8c}",
    "1",
    3,
    "",
    "",
    "",
    "Full",
    "QueryDataHField_ctl00_MSOTlPn_EditorZone_Edit0g_f063d9b7_6261_4e85_9297_28a2ad8fabcd");

Once the Page is in Edit-Mode AND the WebProperties pane is opened.

It is clear that some javascripts need to load in order to load the global Search object.

 

#Question

Before I start hunting down which JS files are required, and figuring out what the parameters do

Has any one done this yet?

0 Replies