UX - Automatic wildcard - Simple Search

How would I intercept this SOAP query being built to say, "If no ending wildcard, add asterisk."

Req URL:[POST] http://localhost/InnovatorServer12/Server/InnovatorServer.aspx

ContentType: XML

Node name, label, with condition="like" (can't post SOAP request here without converting/encoding html entities).
Where, currently (v12sp5), a search term "Product" would not return "Product Management", but the search term, "Product*" would. I believe this wildcard functionality should be built-in/inherent. I'm not the quickest to SHIFT-NUMBER, so maybe that's why it irks me, but also all major search engines support this inherent wild card - so, putting myself in the shoes of someone that just learned to function the interwebz would be confused here, and maybe think something is missing...?

Parents
  • Hi Neil,

    I've heard of customers in the past who have extended the default search inside of the Innovator client to automatically include wildcards as you're describing. As a note before I get into the details, I'd like to mention that this change will affect all search grids in your database. Because of this, I'd recommend taking a backup of your database before you make any changes and to also test these changes in a development instance before applying it to production.

    If you go to any search grid inside of Innovator, you'll see that next to the Search and Clear buttons, there's a dropdown that lets you pick the type of search you want to run. Since the Advanced and AML search modes already have options for searching with a like condition, you'll likely want to modify the Simple search. All of these search modes are actually stored as instances of an ItemType in the database called SearchMode that is not visible on the TOC by default. However, if you login as an admin, and you can modify this ItemType to add a TOC Access to view it. 

    From here, you can go to this ItemType in the TOC and modify the Simple search mode. Note that you'll need to be logged in as the root user in order to modify these items since they are so wide-reaching. Once you open up the Simple search, you'll want to modify the search handler which is a JavaScript class that defines how the search will look and work. There should be a function here that's responsible for converting the input of the user into the AML that will be sent to the server. You can modify the piece of code that does this to automatically add wildcards to any properties that are present. By default, the search handler is kept inside of a plain text field. I'd recommend copying it out to a text editor that will format the code you add more nicely and then copy it back in when you have finished your changes.

    Note that in addition to customizing search modes, it's also possible to add your own. If you're hesitant to jump directly into editing the existing Simple search mode, you may want to instead just make a copy of the Simple search to test your changes in. 

    Chris


    Christopher Gillis

    Aras Labs Software Engineer

Reply
  • Hi Neil,

    I've heard of customers in the past who have extended the default search inside of the Innovator client to automatically include wildcards as you're describing. As a note before I get into the details, I'd like to mention that this change will affect all search grids in your database. Because of this, I'd recommend taking a backup of your database before you make any changes and to also test these changes in a development instance before applying it to production.

    If you go to any search grid inside of Innovator, you'll see that next to the Search and Clear buttons, there's a dropdown that lets you pick the type of search you want to run. Since the Advanced and AML search modes already have options for searching with a like condition, you'll likely want to modify the Simple search. All of these search modes are actually stored as instances of an ItemType in the database called SearchMode that is not visible on the TOC by default. However, if you login as an admin, and you can modify this ItemType to add a TOC Access to view it. 

    From here, you can go to this ItemType in the TOC and modify the Simple search mode. Note that you'll need to be logged in as the root user in order to modify these items since they are so wide-reaching. Once you open up the Simple search, you'll want to modify the search handler which is a JavaScript class that defines how the search will look and work. There should be a function here that's responsible for converting the input of the user into the AML that will be sent to the server. You can modify the piece of code that does this to automatically add wildcards to any properties that are present. By default, the search handler is kept inside of a plain text field. I'd recommend copying it out to a text editor that will format the code you add more nicely and then copy it back in when you have finished your changes.

    Note that in addition to customizing search modes, it's also possible to add your own. If you're hesitant to jump directly into editing the existing Simple search mode, you may want to instead just make a copy of the Simple search to test your changes in. 

    Chris


    Christopher Gillis

    Aras Labs Software Engineer

Children