Search Result Page Implementation

Options

Hello,

I have been able to create custom commands, new widgets in the new Smart UI and open classic view pages from Smart Vew, albeit with addional configuration steps in <prefix>-all.js. But I not could find any any documentation or examples on how Search Result page  is implemented.

When a Search is performed in any perspective, Landing page or container, irrespective of the layouts, it loads the Search results in a full page with a back button to return to the current perespective. How is this implemented? Custom Perspective with single full page widget is created on the fly and the Search results are rendered ? Or a url router is used ? 

Regards,
Siva Prasad

Comments

  • Hi Siva Prasad, 

    It took me some time to create the Sequence diagrams, which you find attached to the post. Hope that gives you a clearer picture what is going on behind the scene when the Search Result page is shown. (I also added a simplified view, which describes the situation on the demo page, using PageContext)

    Regards,

    Leonhard.

  • Thanks, Leonhard! The diagrams explain also a great deal how a perspective gets loaded, widgets created and their data fetched.

    Yes, the search perspective contains the full-page-sized search results widget. And it doesn't come from the server. (There has been no requirement to customize it by the administrator. That is why we started with the configuration bundled as a Require.js module in the compiled code. It may be changed with future requirements.)

    If you want to show a custom page in Smart UI, you would create a new perspective. The current Smart UI can only navigate among perspectives. The task means deciding for the URL of your page and then implementing a perspective context plugin loading the perspective, a perspective router plugin maintaining the URL and finally new widgets, if the stock ones are not enough. It is one of the most complicated Smart UI customizations. If you want to put a bunch of custom widgets together on a page, it is much easier to create a special node and configure the perspective by Perspective Manager, even if you needed to develop a couple of custom widgets :-)

  • Thanks Ferdinand , this is what I was chasing for. I have been following your replies on other threads in  this Smart UI SDK Forum and I can vouch that your responses, in a way, are filling the gaps in the current sdk documentation.

    Thanks Leonhard, for the sequence diagrams and for the simplified view. It's very useful.

     

    Regards,
    Siva Prasad

  • This is quite old post but it seems very important. I am looking for a solution like this. I just wanna trigger search from a button. Let´s say I will have a button - FIND DOG! - this button should fire search request the same way like you would do it with typing DOG into search bar. Can you @Siva Prasad Salipalli help me with this?

  • I was looking at search.custom.view widget. I was curious how this guy is triggering the search. I found a method there, which is probably responsible for starting search. See the picture . But what the **** is listening ? :)

  • Why don’t you create a save search object with your query and just open the object?

    Or do you need the results be restricted to the current location?

    If the above approach doesn’t work you could create a custom search widget with the query, hide the widget and activate its search button.

    Hans
  • JaKar
    edited March 2, 2023 #8
    Options

    Thank you @Hans Stoop I would like to use complex query in my search which will be dynamically created during a session. I need to use AND and OR operators. It this possible for custom search widget to use such a complex query? One attribute - Attr_534085_7 - is used multiple times.

    ([QLREGION "Attr_534085_5"]="111") & [QLREGION "Attr_534085_7"]="D"))|(([QLREGION "OTModifyDate"] (> 20230227)) & [QLREGION "Attr_534085_7"]="M"))

  • From what I have learned so far, I need a model received from a context

    searchQueryModel = pageContext.getModel(SearchQueryModelFactory),
    

    then I can trigger find and display results in

    searchResultsView = new SearchResultsView({
                    context: pageContext,
                    enableSorting: csui.searchSettings.enableSorting,
                    enableSearchSettings: csui.searchSettings.enableSearchSettings,
                });
    

    all of this can happen in modal popup window or in a perspective with a special widget.

  • JaKar
    edited March 2, 2023 #10
    Options

    I cannot see the content of the second codeblock. Is it only problem on my side, or you guys see the empty space also?

    searchResultsView = new SearchResultsView({                context: pageContext,                enableSorting: csui.searchSettings.enableSorting,                enableSearchSettings: csui.searchSettings.enableSearchSettings,            });

    ****, these buggy forums driving me crazy. :(

  • JaKar
    edited March 2, 2023 #11
    Options

    The magic of displaying the results ishappening in the method below. Because the search query model is returned by a factory provided with pagecontext, it must be the one who is listening - it can be seen in the provided diagrams :)

  • Yes, youjust set up the form correclty vi ath eadvanced search page. You then also need to dynamically set the filed value.

  • Not sure what you mean :) can you provide a screen for ilustration?

    Eventually I was able to find a way. Seems that is so simle, but the lack of the documentation makes it super hard to discover :)