More in this section

Forums / Developing with Sitefinity / Mutiple search queries in sitefinity search

Mutiple search queries in sitefinity search

2 posts, 0 answered
  1. Dev
    Dev avatar
    18 posts
    18 Jan 2013
    25 Feb 2013
    Link to this post


    here is my problem, 

    I am using the search results control of sitefinity.

    I have a search term, let's say "Term1" which returns 5 results.

    I have another term , lets say "Term2" which returns 3 results.

    Now when I search for "Term1 Term2" sitefinity is returning just 1 result. It is trying to find the results which have both the terms in it. But I am looking for the opposite results, I dont want the intersection of these two terms, I want union of both the results, I mean I want to see 8 results (5 for term1 and 3 for term 2) 

    Please let me know how we can do this.


  2. Victor Velev
    Victor Velev avatar
    1345 posts
    06 Jul 2015
    28 Feb 2013
    Link to this post
    Hi Prashant,

    Currently our search control is built on the match case logic which finds exact match of the words that are being searched for. However, you have the option to override the initializeControls method in the Search Results control in order to extend the default logic of the control. There is one variable:

    var result = searcher.Search(searchQuery, this.IndexCatalogue, skip, take, out totalItems);

    However you can extend the functionality and create a foreach loop for each of words that are being searched. Then you can pass the results in the above variable.

    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered