Forum Discussion

iftomkins's avatar
11 years ago

How to exclude duplicate topics from search results?

We are using a modified version of the search component. We'd like to exclude topics marked by moderators "duplicate" from showing in the results of this particular search component.

 

How can we filter the search results? Is there way to check if the topic is a duplicate via the API?

 

Here is the code from our customized search component (very similar to functionality of new search box on Lithosphere):

 

<div class="lia-panel-heading-bar-wrapper"><div class="lia-panel-heading-bar"><span class="lia-panel-heading-bar-title ask-a-question-search">${text.format('taplet.askTheExpertTaplet.title')}</span></div></div>

<div class="custom-search-wrapper">
    <div id="custom-search-border">
        <@component id="common.widget.search-form" />
    </div>
    <span class="lia-button-wrapper lia-button-wrapper-primary">
	    <input type="hidden" name="submitContextX" value="Continue"><input type="submit" name="submitContext" id="submitContext" value="${text.format('form.AskAnExpertForm.action.AskTheCommunity.title')}" class="lia-button lia-button-primary lia-button-Continue-action " title="${text.format('form.AskAnExpertForm.action.AskTheCommunity.title')}">
    </span>
</div>

 

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)

    Hi iftomkins ,

     

    In your community, is "duplicate" a tag, a label or custom tag or metata?

     

    you can write some Javascript, which query an endpoint and append to the search box. In your endpoint, you need to call REST search api and exlude the posts with tag "duplicate".