How to capture input text in the search field and show custom search results in Service portal

Shivanand F Mad
Giga Guru

Hi All,

 

We have custom widget, in the search field we are showing the search results using the record picker. 

<div style="margin-bottom:60px;">
<div class="col-sm-6">
<p class="<CLASSNAME>" ng-if="c.choice == 'product_name'" ng-model="c.productName">
<sn-record-picker field="sku_list_id" table="'<TABLENAME>'" display-fields="'item_description'" value-field="'item_description'" default-query="'<QUERY>'" search-fields="'<FIELDS>'" on-change="c.handleChange(val)" page-size="5" name="itemDescription"></sn-record-picker>
</p>
</div>
<div class="col-sm-4">

 

Below is the search field. Right now it is working as "STARTSWITH" by default. 

ShivanandFMad_0-1718684304490.png 

And we can make it work as "CONTAINS" by changing the system property "glide.ui.ref_ac.startswith". 

 

ShivanandFMad_2-1718684776763.png

Question:

But the requirement is user want to see search results based on the combination of the words they type. 

That is if user types "apple cable", search should pick up these words (apple & cable) search by adding AND query from the table. 

Basically, whatever user types takes those space separated words and search from the table using AND query.

Ex: "Apple Iphone" and "Iphone apple" --> should give the same results. Right now it is not working in both STARTSWITH and CONTAINS search results.

 

Please help me with the solution.

 

Can we do it? If yes, how?

 

#serviceportal #portal #customwidget

 

0 REPLIES 0